Remove user from Sharepoint group using powershell

PS C:\Users\ADM> $spWeb = Get-SPWeb http://abc/
PS C:\Users\ADM> $group=$spWeb.SiteGroups[“Legal Approvers”]
PS C:\Users\ADM> $group.Users
PS C:\Users\ADM> $theuser = $spWeb.AllUsers.Item(“SHAREPOINT\system”)
PS C:\Users\ADM> $group.RemoveUser($theuser)
PS C:\Users\ADM> $group.Update()
PS C:\Users\ADM> $group.Users
Advertisements

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