Sunday, February 24, 2013

Tips for SharePoint 2013 PowerShell

As Administrator , he can perform most of administration jobs from UI but with SharePoint 2013 there are some changes required only PowerShell like Modify Search topology or Configure Request Management...
  • Still you can use stsadm commands with SharePoint 2013
  • To grant the users permission to run the commands grant them the following :
    • Member of SharePoint Shell Access role
    • Memeber of local security group (WSS_ADMIN_WPG)
  • To get list of stsadm commands , run the following :
  • stsadm
    
  • To get list of commands in SharePoint 2013 PowerShell , run the following :
  • Get-Command
    
  • To get list of commands with filtering , run the following to get commands for SPWeb only:
  • Get-Command -Noun SPWeb
    
  • To get list of commands start with , run the following :
  • Get-Command -Noun SPW*
    
  • To get help about the command , run the following and you can pass -Examples or -Full or -Details for more information :
  • Get-Help Get-SPWeb
    
  • To get the command object or objects wrap it with ()
  • (Get-SPSite http://sps2013).RootWeb.Lists | ForEach-Object {$_.Title}
  • You can dispose SPWeb or SPSite using for example $site.Dispose() or can use like using keyword in C# (wrapping the whole script) with Start-SPAssignment -Global and Stop-SPAssignment -Global
  • To Get Correlation ID from logs file , run the following :
  • Get-SPLogEvent | ?{$_.Correlation -eq "<ID>"}
    

No comments:

Post a Comment