If you would like to update Active Directory User/Group profile information in a SharePoint 2007 site, you can use the commands given below to achieve this.
- [Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Culture=Neutral, PublicKeyToken=71e9bce111e9429c")
- $site = New-Object -TypeName Microsoft.SharePoint.SPSite -ArgumentList http:
- $group = $site.RootWeb.SiteUsers["Domain\grouploginname"]
- $group.Name = "Group Name"
- $group.Email = "[email protected]"
- $group.Update()
Important Note
SID should match in both Active Directory and SharePoint for the user/group, else the steps given above will not work.
To check the SID of a group from Active Directory
Command - wmic useraccount where name='grouploginname' get sid
To check the SID of a group In SharePoint
Look for the user profile database to get the SID of the group.