When SharePoint is initially set up, many users may need to be added to SharePoint groups for a new site. The quickest and most efficient way to accomplish this is through PowerShell and scripting.
The following recipe shows how to add a user to a SharePoint group via PowerShell.
The user must have access to one of the servers running PowerShell 2.0 and be a member of the WSS_ADMIN_WPG
on the local computer. You must also be a member of the SharePoint_Shell_Access
role on the configuration database (SQL Role).
There must be an existing site, a SharePoint group called TestAddUser
, and a user named jdoe
set up in the active directory.
1. Click on the Start button on the web front end.
2. Under All Programs, navigate to the
Microsoft SharePoint 2010 Products
folder.3. Right-click on the SharePoint 2010 Management Shell option and click Run as Administrator. The PowerShell console will appear.
4. Type the following command into the console...