Monday, May 30, 2011

Document Information Panel was unable to load

Last week I was working on an strange issue. Some of the users were getting "The Document Information Panel was unable to load. The document will continue to open. For more information, contact your system administrator." when ever they try to open the office document from an WSS 3.0 site.

On analysing found one column in the library had flower braces {} in its description. Replacing the {} with () dissappered the error message.

Labels:

Removing user from site using PowerShell

Remove-SPUser command is used to remove user from the site.


Remove-SPUser $useraccount -web $web -confirm:$false;

Labels:

Thursday, May 26, 2011

People Search and Bets Bets web part

Search Best Bets web part works only when it is added on the content search results page(results.aspx). This web part doesn't work when it is added on the people search results page(peopleresults.aspx). There are few other web parts whose behaviour changes based on which page layout it is added to in the search center.

Search Action Links web part is one of them. When it is added on the content search results page the sort options are different compared to when it is added on people search results page. On content search results page it give sort by Relevance and Modified date. Where as when it is on the people search results page it shows the sort by Default, Name and Social Distance.

Another major difference in web part's behaviour is of Refinement Panel web part (SharePoint 2010). Even if you add the People Refinement Panel web part on the content search results page, it behaves as normal refinement panel web part. This is same even after changing the Filter Category Definition of the web part.

Labels: ,

Wednesday, May 25, 2011

Adding user to a site using PowerShell

Started exploring the PowerShell commands on SharePoint 2010.

New-SPUser command is used to add user to the site.

Below script gets the .csv file as input parameter which contains the URL, domain account, permission level.

AddUsers.PS1
-----------------------------------------
param(
[String]$InputFile = ""
)

$SitesList = Import-CSV $InputFile;

ForEach ($s in $SitesList)
{
$web = Get-SPWeb -identity $s.URL;

New-SPUser $s.Useraccount -web $web -PermissionLevel $s.Permission -confirm:$false;

$web.Dispose();
}

"Complete";
-----------------------


Sites.csv
----------
URL,Useraccount,Permission
http://test.com/sites/xyz,domain\user1,Contribute
-----------

To run the command
PS> AddUsers.PS1 -InputFile Sites.csv

Labels: