SPS2010 running stsadm –o migrategroup command keeps the old group name and does not replace with the new name


I already posted a script for this issue but for MOSS 2007. With SPS2010 this still happens when you change the account name (and maybe more) for an AD Group. Now with the PowerShell integration it is easier than for MOSS.

Why we need all those steps?

SharePoint Profile import cannot check whether a user has a different account also because of security reasons. That means we need to run STSADM –o MigrateUser. During the lifetime of MOSS 2007 we added some code to also use STSADM –o MigrateGroup. Both commands are only change the AD account name.

Example:

Old: Domain\GregSmith
New: Domain\GregLogan

All the other properties for that user will be changed with the next incremental user profile import. But not for AD Groups.

To change also all the other possible properties for an AD Group you can use the following PowerShell script.

$login= "domain\groupName" # fill with correct value

$title = "new title" # fill with correct value

$emailAddress = "new email" # fill with correct value

Get-SPSite -Limit all | % {$domainGroup = $_.OpenWeb().SiteUsers[$login]; if ($domainGroup -ne $null) {$domainGroup.DisplayName=$title; $domainGroup.Email=$emailAddress; $domainGroup.Update()}}

Please be sure that you start the SharePoint PowerShell shell in the right way.

Comments (0)

Skip to main content