Posts

Free Disk Space on SQL Server

Image
We often are needed to develop command and control systems. What happens if we need to develop a system that tell us about disk space SQL server Here is the code Select @@servername as 'SQL Server Name' , getdate() as Date     EXEC master..xp_fixeddrives Yours, Roi 

Update and synchronize user names in SharePoint

Image
Often - people change their names in the organization - getting married, getting divorced, or just decide to change their name because ... For some reason, SharePoint can not synchronize the new names. Here's a command  for a version of SharePoint 2007 and up that will help you stsadm -o migrateuser -oldlogin Domain\OldUserName -newlogin Domain\NewUsername -ignoresidhistory For a version of SP 2010 and up , With PowerShell Move-SPUser –Identity " Domain \ OldUserName " –NewAlias "Domain\ NewUsername " Enjoy, Roi

Procedure links to government sites

Image
Some of the requirements of government Web sites or sites of municipal authority, that if there is an external link, the client will notice that explains to him that the site is directed not belong to the same authority. Here is a Jquery code that can help you $(document).ready( function () {     $( "a" ).click( function ( event ) {         // check if the target link is yoursite.gov         // if not will show alert message         if ( this .href.indexOf( "yoursite.gov" ) == -1) {             if ( this .href.startsWith( "http" )) {                 event .preventDefault();                 var linkLocation = this .href;  ...

SharePoint List showed twice

Image
You happen to write a List Definition and of course it Schema.xml file. I also went a few times :) But .. What happens that you copy a code that you have before? It is said that the "copy - paste" is the programmer's best friend (after Google, of course) I copied DefaultView=true twice, and I see it in "view all site content" the list showed twice (each time for a different view) <Views>    ...    <View>      ...      DefaultView = "True"      ...    </View>    <View>      ...      DefaultView = "True"      ...    </View> </Views> All you need to remember is to type only "DefaultView = true" once! Roi.  

Add-SPSolution: Failed to extract the cab file in the solution

Image
Did you happen to get the following error message when you did the command  Add-SPSolution at PowerShell (or stsadm -o addsolution ...)? Add-SPSolution: Failed to extract the cab file in the solution Add-SPSolution: Failed to extract the cab file in the solution In my case a file called by graphic artist as q&a.jpg (questions and answers). Apparently not to use the characters in solution as ~ ! @ # $% ^ & * Who had written DDF files should know that. I've forgotten :) Enjoy, Roi Kolbinger

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters

Image
When you try to compile a project in visual studio and get this message The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters All you need is to correct an error that VS created (and I do not know how) He has written a number of times in the " Deployment Path " "$ SharePoint.Project.FileNameWithoutExtension $ _ $ SharePoint.Feature.FileNameWithoutExtension $" Instead of one in " Deployment Path " It should be like this "YourValue_ $ SharePoint.Feature.FileNameWithoutExtension $" Yours, Roi  

Image not rendered at RichImageF​ield

Image
Who has not sat for hours on code and trying to figure out a problem. This happens to me from time to time. This time I will share with you in case of building PageLayout allows adding an image ( RichImageField ). Microsoft's programmers apparently thought that the "order" is important. Also does not make any sense. That's what comes of trying to add RichImageField and rendered no image. We are in "&#160;" instead of a image. Now if we reduce the RichImageField down (in my case under RichHtmlField)... Everything works fine. Microsoft programmer with a sense that I do not understand - can someone explain to me? I hope I helped, Roi