O'Reilly logo

Microsoft SharePoint 2010 Administration Cookbook by Peter Serzo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a user via PowerShell

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.

Getting ready

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.

How to do it...

  1. Click on the Start button on the web front end.
  2. Under All ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required