You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sharepoint/docs-conceptual/sharepoint-server/sharepoint-server-cmdlets.md
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,24 @@
1
1
---
2
2
title: SharePoint Server Cmdlets
3
+
ms.service: sharepoint-powershell
3
4
---
4
5
5
6
# SharePoint Server Cmdlets
6
7
7
8
For a listing of the SharePoint Server cmdlets, see [SharePoint Server cmdlets](xref:SharePointServer)
8
9
9
-
## Accessing PowerShell for SharePoint Server ##
10
+
## Accessing PowerShell for SharePoint Server
10
11
11
12
After you install SharePoint Server, applicable PowerShell cmdlets are available in the SharePoint 2016 Management Shell. You can manage most aspects of SharePoint Server in the SharePoint Management Shell. You can create new site collections, web applications, user accounts, service applications, proxies, and more. Commands that you type in the SharePoint Management Shell return SharePoint objects that are based on the Microsoft .NET Framework. You can apply these objects as input to subsequent commands or store the objects in local variables for later use.
12
13
13
14
With the SharePoint Management Shell, you do not have to register the snap-in that contains the cmdlets. Registration of the Microsoft.SharePoint.PowerShell.dll module for SharePoint Server cmdlets is automatic, as a result of the **Add-PSSnapin Microsoft.SharePoint.PowerShell** line in the SharePoint.ps1 file that is located in %CommonProgramFiles%\Microsoft Shared\Web Server Extensions\<version>\Config\PowerShell\Registration, where version "15" equals SharePoint Server 2013, and version "16" equals SharePoint Server 2016. To use the PowerShell console, you must register this snap-in manually.
14
15
15
-
Whether you use the SharePoint Management Shell or the PowerShell console, you can also load additional snap-ins.
16
+
Whether you use the SharePoint Management Shell or the PowerShell console, you can also load additional snap-ins.
16
17
17
18
> [!NOTE]
18
19
> The SharePoint Management Shell and the PowerShell console also differ in the use of the **ReuseThread** option, which defines how the threading model is used. The SharePoint Management Shell's use is defined by this line, {Host.Runspace.ThreadOptions = "ReuseThread"}, which is in the SharePoint.ps1 file. For more information, see [PS Thread Options](/dotnet/api/system.management.automation.runspaces.psthreadoptions).
19
20
20
-
## Permissions ##
21
+
## Permissions
21
22
22
23
Before you can use the Add-SPShellAdmin cmdlet to grant permissions for users to run SharePoint Server cmdlets, verify that you meet all of the following minimum requirements:
23
24
@@ -31,15 +32,15 @@ For additional information about PowerShell permissions, see [Add-SPShellAdmin](
31
32
32
33
If you do not have membership in the **SharePoint_Shell_Access** role or **WSS_Admin_WPG** local group, use the **Add-SPShellAdmin** cmdlet to add the **WSS_Admin_WPG** group in all front-end web servers in the SharePoint farm and the **SharePoint_Shell_Access** role. If the SQL Server database does not have a **SharePoint_Shell_Access** role, the role is automatically created when you run the **Add-SPShellAdmin** cmdlet. After you run the **Add-SPShellAdmin** cmdlet, users can run SharePoint PowerShell cmdlets in a multiple-server farm environment.
33
34
34
-
**NOTE:** When you install SharePoint Server, the user account from which you run the installation is granted the appropriate permissions to run PowerShell cmdlets. If any users have not been added to run a PowerShell cmdlet, you can use the **Add-SPShellAdmin** cmdlet to add them.
35
+
> [!NOTE]
36
+
> When you install SharePoint Server, the user account from which you run the installation is granted the appropriate permissions to run PowerShell cmdlets. If any users have not been added to run a PowerShell cmdlet, you can use the **Add-SPShellAdmin** cmdlet to add them.
35
37
36
38
To see a list of all of the **SPShellAdmin** cmdlets, from a PowerShell command prompt, type _Get-Command -Noun SPShellAdmin_.
37
39
38
-
## Scripts and execution policies ##
40
+
## Scripts and execution policies
39
41
40
-
Although you can use Microsoft PowerShell to perform a single administrative task, you can also use a script to automate a series of tasks. A script is a text file that contains one or more Microsoft PowerShell commands. Microsoft PowerShell scripts have a .ps1 file name extension.
42
+
Although you can use Microsoft PowerShell to perform a single administrative task, you can also use a script to automate a series of tasks. A script is a text file that contains one or more Microsoft PowerShell commands. Microsoft PowerShell scripts have a .ps1 file name extension.
41
43
42
44
To run scripts, the minimum required execution policy for SharePoint Server is **RemoteSigned**, although the default policy for PowerShell is Restricted. If the policy is left as Restricted, the SharePoint Management Shell will change the policy for PowerShell to RemoteSigned. This means that you must select **Run as administrator** to start the SharePoint Management Shell with elevated administrative permission. This change will apply to all PowerShell sessions. For more information, see [ExecutionPolicy Enumeration](/dotnet/api/microsoft.powershell.executionpolicy).
43
45
44
46
For additional information about scripts and execution policies, see [about_scripts](/powershell/module/microsoft.powershell.core/about/about_scripts) and [About Execution Policies](/powershell/module/microsoft.powershell.core/about/about_execution_policies).
0 commit comments