Set-SPUser
Applies to: SharePoint Server 2010, SharePoint Foundation 2010
Topic Last Modified: 2010-02-15
Configures properties on an existing user.
Set-SPUser [-Identity] <SPUserPipeBind> [-AddPermissionLevel <String[]>] [-AssignmentCollection <SPAssignmentCollection>] [-ClearPermissions <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-DisplayName <String>] [-Email <String>] [-Group <SPGroupPipeBind>] [-IsSiteCollectionAdmin <SwitchParameter>] [-MobileNumber <String>] [-PassThru <SwitchParameter>] [-RemovePermissionLevel <String[]>] [-SyncFromAD <SwitchParameter>] [-Web <SPWebPipeBind>] [-WhatIf [<SwitchParameter>]]
The Set-SPUser cmdlet configures properties on an existing user.
| Parameter | Required | Type | Description | ||
|---|---|---|---|---|---|
| Identity | Required | Microsoft.SharePoint.PowerShell.SPUserPipeBind | Specifies the GUID, login name, or SPUser object of the user to be returned. The type must be a valid GUID of the user, in the form 1234-5678-9876-0987. | ||
| AddPermissionLevel | Optional | System.String[] | Specifies the permission level to add to the user. The type must be any one of the following types: -- Contribute - Can view, add, update, and delete list items and documents. -- Design - Can view, add, update, delete, approve, and customize documents. -- Full Control – Has full control to all documents. -- Limited Access - Can view specific lists, document libraries, list items, folders, or documents when permissions are granted. -- Read - Can view pages and list items and download documents. | ||
| AssignmentCollection | Optional | Microsoft.SharePoint.PowerShell.SPAssignmentCollection | Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.
| ||
| ClearPermissions | Optional | System.Management.Automation.SwitchParameter | Clears all given permissions from the user. If Clear and Add values are given, the permissions are first cleared, then the new permissions are given. | ||
| Confirm | Optional | System.Management.Automation.SwitchParameter | Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters | ||
| DisplayName | Optional | System.String | Specifies the new display name of the user. The type must be a valid name. | ||
| | Optional | System.String | Specifies the new e-mail address of the user. | ||
| Group | Optional | Microsoft.SharePoint.PowerShell.SPGroupPipeBind | Adds the user to the specified named group of the given site. | ||
| IsSiteCollectionAdmin | Optional | none | Specifies whether to set the user as a site collection administrator. | ||
| MobileNumber | Optional | System.String | Sets the new mobile number for the user. | ||
| PassThru | Optional | none | If not provided, indicates that this cmdlet has no output. If provided, this parameter indicates that the SPUser object for this user is to be returned. | ||
| RemovePermissionLevel | Optional | System.String[] | Removes the permission level from the user. | ||
| SyncFromAD | Optional | System.Management.Automation.SwitchParameter | If provided, specifies that user information will be synchronized from the user directory store. | ||
| Web | Optional | Microsoft.SharePoint.PowerShell.SPWebPipeBind | Specifies the name of the URL or GUID to be used as a scope. This parameter is not needed if the SPUser object is provided as the identity. The type must be a valid URL, in the form http://server_name, or GUID, in the form 1234-5678-9807. | ||
| WhatIf | Optional | System.Management.Automation.SwitchParameter | Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters |
------------------EXAMPLE-----------------------
Set-SPUser -Identity 'Contoso\jdoe' -Web http://test -AddPermissionLevel "Contributor"
This example sets a user (Contoso\jdoe) to be a contributor on http://test.

Note