A utility library for SharePoint 2010 administration where I place common useful functions.Usage:
#Import the Administration library. .\Administration.ps1#Perform action, example:Banner "Check-Replicate-changes.ps1" "Production" "2011-05-09" "1.0" "Verifies replicate changes permissions"Check-ReplicateChanges("MYDOMAIN\SPSPROFILE")
Pausev1Check-ReplicateChanges($userName)Checks to see if an account has Replicate Changes rights in AD.
Important tool used to verify setup for profile sync service accounts.
NOTE! Does not work for checking domain administrator accounts.
Thanks to Bugra Postaci at
http://bit.ly/j4xQrNPause Waits for the user to press a key before continuing.
Banner $ScriptName $Environment $LastModified $Version $ScriptDescription Displays a script banner when running a script giving information on
the creator of the script, the purpose, version and last modification date.
WaitForDeploymentToFinish $SolutionFileName Waits until the deployment of a solution package has completed.
Use in combination with, for example, Install-SPSolution
Get-ScriptDirectoryGet-ScriptDirectory $file Gets the path of the current script folder. Use with optional $file parameter
to return the full path for the specified file in the current folder.
v1.1Set-ServiceAccount $service $accountSets the service account for a SharePoint service to an AD domain user.
Example: Set-ServiceAccount "SPTraceV4" "DEV\SP_SERVICE"
Thanks to Octavie van Haaften at http://bit.ly/lG6AZ2
Export-SolutionsExport-Solutions $pathExports the farm solutions from your farm to the file system.
Optionally, specify target folder using $path.
Thanks to Shane at http://bit.ly/k82a5Z
v1.2Enable-DeveloperDashboardEnables the developer dashboard
Reset-PageLayouts $IdentityUn-ghosts and resets page layouts to site defintion
Thanks to Dirk Van den Berghe at http://bit.ly/rayyne
v1.3Enable-Claims $IdentityConverts a Classic mode web application to use Claims authentication