Tuesday, July 26, 2011

SharePoint Workspace, Property name invalid

I had a number of users receiving a "Property name invalid" error when trying to sync to a SharePoint site in SharePoint Workspace. After numerous attempts at resolving the issue by running repair, un-install and reinstall with no success, I did some more research around the error message and found it was most likely a result of the XML parsing. After some further monitoring and log surfing i came up with the following solution.




  1. Select Start > Run


  2. Type “cmd” and select run


  3. Run the following commands


  4. Regsvr32 c:\windows\system32\msxml3.dll


  5. Regsvr32 c:\windows\system32\msxml6.dll


  6. Restart the computer


The users were all running Windows XP, Office 2007 and SharePoint Workspace 2010

Friday, July 8, 2011

PowerShell to Migrate Files from the File System to a SharePoint Document Library

I had the requirement to copy all files and folders from a fileshare directly into SharePoint. Normally i would have just used explorer view however the terminal server that was being used didn't have the web client installed. I used the following poweshell to get the documents migrated
NOTE: this does not migrate security
NOTE: does not check for invalid charcters
NOTE: must be run on a sharepoint server joined to the farm


function ProcessDirectory($directory, $spfolder){
$directory.GetDirectories() foreach{
#create direcotry
write-host "creating directory" $_.Name
$newfolder = $spfolder.SubFolders.Add($_.Name)
#recurse directory
ProcessDirectory $_ $newfolder
}
$directory.GetFiles() foreach{
#uploadfile
write-host "uploading file" $_.Name
$newfile = $spfolder.Files.Add($_.Name,$_.OpenRead(),$true)
}
}
#you could use a local drive. If migrating from a remote server mount the share
#net use X: \\fileshare\sharename
#change current directory
x:
#get web
$web = get-spweb "http://companyweb"
#get the document library
$list = $web.Lists["TestMigration"]
$rootfolder = $list.RootFolder
#get DirectoryInfo object
$currentfolder = get-item .
#start process
ProcessDirectory $currentfolder $rootfolder

Wednesday, June 8, 2011

Unexpected error occurred while communicating with Administration Service

Ran into the following issue when attempting to access "FAST Search keywords" from the site collection, even though i could access the fast adminstration from Central Administration. After some investigation i found that the web application app pool account had not be added to the FASTSearchAdministrators group on the Administration node of the FAST Farm (as mentioned in the technet article). After adding the account I was still receiving the error, after wading through the ULS logs i found the wcf service was returning with exception: "The trust relationship between the primary domain and the trusted domain failed". There are plenty of blogs out there detailing the exception, long story short it occurs when Principal.Isinrole is called to check permissions and the group used does not exist. I thought the wcf service was probably looking for the optional Security group and when it could not find it locally was going out to the domain, which obviously has issues. My resolution was to create the optional group FASTSearchKeywordAdministrators group (detailed in the technet article). I then added my app pool account to the group and everything started working as it should.

From the article: "The FASTSearchKeywordAdministrators group is not automatically created during installation, but can be created manually if you want to use this level of authorization."

Monday, November 1, 2010

Word Automation Services Job History

I recently had to make use of the Word Automation Service application to convert word documents to pdf within sharepoint. If you have used the service application before you will be aware that once you queue a document you have to wait for the timer job to run before the document can be converted. There are some solutions which poll the service to see if the conversion process has completed successfully, but what if you what to view the status of previous and failed conversions? I couldn't find anywhere within Central Administration to view the history (let me know if I'm missing something!).

I knocked together the following powershell to output the jobs and their status.

[void][reflection.assembly]::Loadwithpartialname(“Microsoft.Office.Word.Server") out-null
[Microsoft.Office.Word.Server.Conversions.ConversionJobStatus]::GetAllJobs("Word Automation Services", $null) foreach {
$status = new-object Microsoft.Office.Word.Server.Conversions.ConversionJobStatus("Word Automation Services", $_.JobId,$null);
$_;
$status;
$status.GetItems([Microsoft.Office.Word.Server.Conversions.ItemTypes]::Succeeded)
$status.GetItems([Microsoft.Office.Word.Server.Conversions.ItemTypes]::InProgress)
$status.GetItems([Microsoft.Office.Word.Server.Conversions.ItemTypes]::NotStarted)
$status.GetItems([Microsoft.Office.Word.Server.Conversions.ItemTypes]::Failed)
$status.GetItems([Microsoft.Office.Word.Server.Conversions.ItemTypes]::Canceled)

}

Wednesday, July 21, 2010

SP2010 Powershell Access Denied

If your using power shell to do anything (in my case upgrade user experience) and you get access denied even though you’re an administrator in as many places as you can think of. Add your account to shell admin using add-spshelladmin.

Thursday, March 20, 2008

I need to webpart

You may have noticed that you cant have 2 working "i need to webparts" on the same page. In order to solve this problem i edited the xslt and modified the javascript function name that was called to my own custom function name. I then added my own function to the master page to handle multiple webparts. If storing in the masterpage is not an option you could make a new/edit a js file in the 12 hive or add the script inline in the xslt.(however the script will be printed for every webpart that appears on the page. This does not cause an issue as the browser will use the last function defined). In order to make the changes quickly to all the webparts and to have more control in the future i stored the xslt in a top level document library then added the url to the xsl link property in the webparts i wanted to use this new script. i also exported and saved the new "i need to webpart"(with xsl link) to the webpart gallery for reuse later on.

Picture library with thumbnail fails to covert to xslt data view

Today i had an issue hen i tried to convert a picture library view to an xslt view to add some custom actions. As soon as i converted the webpart i received an error: "Invalid XSLT stylesheet Error: invalid character". Once i opened the xslt i found that the thumbnail template had not been exported correctly and had malformed xml. Inorder to resolve the issue i simply replaced the thumbnail template with the following....