SharePoint powershell usefull commands for developers
|
List the powershell commands
|
Get-Command
|
|
Restart IIS Services
|
iisreset
|
|
Reference SharePoint Component
|
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
|
|
Returns the names of all users who have the SharePoint_Shell_Access role
|
Get-SPShellAdmin
|
|
Adds a user to the SharePoint_Shell_Access role for the specified database
|
Add-SPShellAdmin {User account name}
|
|
Get the local sharepoint farm
|
Get-SPFarm
|
|
List the web applications
|
Get-SPWebApplication
|
|
List the site collections
|
Get-SPSite
|
|
List the site of a site collection
|
Get-SPWeb -Site {url of the site}
|
|
Removes a user from the SharePoint_Shell_Access role
|
Remove-SPShellAdmin -Username {Account name}
|
|
List the content databases
|
Get-SpDatabase
|
|
Imports an app package
|
Import-SPAppPackage -Path {Path to .spapp file} -Site {Site collection url} -Source {Source of the app}
|
|
Installs an instance of an app
|
Install-SPApp -Web {Web url} -Identity {spapp object returned from import command}
|
|
Uninstalls an instance of an app
|
Uninstall-SPAppInstance -Identity {spapp object returned from get-spappinstance command}
|
|
Updates the app instance
|
Update-SPAppInstance -Identity $instance -App $spapp
|
|
List jobs of a web application
|
Get-SPTimerJob -WebApplication {Web application url}
|
|
Start a job
|
Start-SPTimerJob -Identity {Job GUID}
|
|
List the solution of farm solution store
|
Get-SPSolution
|
|
List the features of the farm
|
Get-SPFeature
|
|
Add a solution to farm solution store
|
Add-SPSolution -LiteralPath {Path to .wsp file}
|
|
Install farm solution to a web application
|
Install-SPSolution -Identity {.wsp file name and extension} -WebApplication {Web App Url} -GACDeployment;
|
|
Update farm solution to a web application
|
Update-SPSolution -Identity {wsp file name and extension} -LiteralPath {Full path of new .wsp file} -GACDeployment
|
|
Uninstall farm solution
|
Uninstall-SPSolution -Identity {wsp file name and extension} -WebApplication {web app url}
|
|
Remove farm solution from the store
|
Remove-SPSolution -Identity {wsp file name and extension}
|
|
Enable farm solution feature on a site
|
Enable-SPFeature -Identity {Feature Name or ID} -Url {Site url}
|
|
Disable farm solution feature on a site
|
Disable-SPFeature -Identity {Feature name or ID} -Url {Site url}
|
|
Installs a SharePoint Feature by using the Feature.xml file
|
Install-SPFeature -path {name of feature.xml store in hive}
|
|
Uninstalls an installed feature definition
|
Uninstall-SPFeature -Identity {Feature name}
|
|
List SharePoint Service Instances
|
Get-SPServiceInstance -Server {Server name}
|
|
Start instance of a SharePoint Service
|
Start-SPServiceInstance {Service GUID}
|
|
Stop instance of a SharePoint Service
|
Stop-SPServiceInstance {Service GUID}
|
|
List the event logs
|
Get-EventLog -List
|
|
Reads/queries ULS trace logs
|
Get-SPLogEvent
|
|
Retrieves Diagnostic Configuration values
|
Get-SPDiagnosticConfig
|
|
Allows setting Diagnostic Configuration values
|
Set-SPDiagnosticConfig
|
|
Returns IDiagnosticsLevel2 objects or displays a list of diagnostics levels
|
Get-SPLogLevel
|
|
Allows the user to set the trace and event level for a set of categories
|
Set-SPLogLevel
|
|
Resets the trace and event levels back to their default values
|
Clear-SPLogLevel
|
|
Ends the current log file and starts a new one
|
New-SPLogFile
|
|
Combines trace log files from all farm servers into a single file
|
Merge-SPLogFile
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.