0

I have 50+ sites and I need to add a user to all those 50+ site. Is there a way to find out which sharepoint group has Read level access and add user to that group for all 50+ site?

0

Please try this

$site=get-spsite http://sitecollection
#get web object
$web=$site.RootWeb

#Enumarate site groups
$web.SiteGroups |select name
#get user object
$user=$web.EnsureUser("domain\XXXX")
#Get group object
$group=$web.SiteGroups["Test Visitors"]
#add user to group
$group.AddUser($user)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.