Add users to SharePoint Group using PowerShell

You can Add user on SharePoint’s Group using Powershell, to do that you just need to know two things:

  • User domain name -> domain\User
  • Group’s name – you can check this on the following post – http://wp.me/p4Hadm-45

Then you can run the following powershell script:

$site=get-spsite http://fcsharepoint

$web=$site.RootWeb

$web.SiteGroups |select name

$user=$web.EnsureUser("LOCALDOMAIN\FCShareUser")

$group=$web.SiteGroups["FCSharepoint Members"]

$group.AddUser($user)
Advertisements

Posted on 07/04/2015, in PowerShell and tagged , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: