SharePoint In Action

An attempt to share my day-to-day SharePoint experience

Archive for the category “SharePoint 2010 Administration”

HTTP Error 503. The service is unavailable (when openning Central Admin)

SharePoint 503 Error

SharePoint 503 Error

Hi all,

I got this error when I was trying to open the central admin. It’s usually an issue with the IIS and application pool that has been stopped. Just make suer your application pools are running by going through the steps below:

1- Try to refresh the application pool, if it stops again try the following steps:

2- In Internet Information Services (IIS) Manager, locate your application pool account and right click on it and choose “Advanced Settings”
Under “Process Model”, find “Identity”
In “Application Pool Identity” window, under “Custom Account” hit the button “Set”
Enter the correct user name and password

If that didn’t help you would need to make sure your SP_Farm and SP_ServiceApps accounts have “Log on as a Batch Job” right in your “Local Policies”. To verify that you would need to:

3- Go to Administrative Tools –> Local Security Policy –> User Rights Assignmet and make sure there is a “Log on as a batch job” policy there

Cheers,
Nader Heshmat

Error: The Method “GetItems” of the type “List” with id “{Lists’s Guid}” is blocked by the administrator on the server

Hi all,

I was using SharePoint Client Object Model when I got the error above. Basically I was trying to get all items from a list using JavaScript’s get_lists function. It seems the function is inaccessible in anonymous mode. The solution is removing the function GetItems from AnonymousRestrictedTypes using PowerShell:

$web = Get-SPWebApplication -Identity http://your web address
$web.ClientCallableSettings.AnonymousRestrictedTypes.Remove( [Microsoft.SharePoint.SPList],"GetItems")
$web.Update()

and in case you change your mind later, you can addf GetItems to AnonymousRestrictedTypes using commands below:

$web = Get-SPWebApplication -Identity http://your web address
$web.ClientCallableSettings.AnonymousRestrictedTypes.Add( [Microsoft.SharePoint.SPList],"GetItems")
$web.Update()

Hope that was useful!

Cheers,
Nader Heshmat

Exporting all SharePoint Group Members Into A File

Hi,
Here is the SharePoint PowerShell script to get all group members for a SharePoint 2010 site and export it to a file:


$mySite = Get-SPSite “your sharepoint site url here”
$txtFile = “c:\groupmembers.txt”
foreach($grp in $mySite.RootWeb.SiteGroups)
{
    "`r`n`r`nGroup Name:” + $grp.Name | Out-File $txtFile -Append
    foreach ($usr in $grp.Users)
    {
          $usr.name + "," + $usr.UserLogin | Out-File $txtFile -Append
    }
} 

Cheers,
Nader Heshmat

Retrieve A Deployed SharePoint 2010 WSP Package

Hi all,
I was just asked to retrieve a few installed WSP packages from our SharePoint 2010 farm. Since this is not available through Central Admin I used this script to retrieve each package using SharePoint PowerShell console:

Step 1- Get a reference to your farm

$myFarm = Get-SPFarm

Step 2- Get the solution file

$solutionFile = $farm.Solutions.Item("mySolution1.wsp").SolutionFile

Step 3- Save the file on your disk

$file.SaveAs("C:\Deployed solutions\mySolution1.28Nov.wsp")

Cheers,
Nader Heshmat

Consolidating SharePoint 2010 Application Pools

Hi All,

SharePoint 2010 recommends maximum of 10 application pools per server. Let’s assume that you place each of your web applications in a different application pool. This will assign one instance of w3wp.exe process per application pool. Considering the fact that each of these processes will use about 100MB of your server’s memory, you might lose some performance on your server due to improper memory management.
One solution is to consolidate the App pools using PowerShell script below using dummy “SharePoint App Pool – 8000” and “http://mywebapp:8000″”http://mywebapp:8000”

$BucketAppPool = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.ApplicationPools | where {$_.Name -eq "SharePoint App Pool - 8000" }
$webapp = get-spwebapplication -Identity "http://mywebapp:8000"
$webapp.Applicationpool = $BucketAppPool
$webApp.Update()
$webApp.ProvisionGlobally()
iisrest

Cheers,
nader Heshmat

Post Navigation