16 April 2013

Remove spaces from distribution group alias


$groups = Get-ADGroup -Filter * -Properties mailNickname
foreach ($grup in $groups){
       Set-ADGroup -Identity $grup -Replace @{mailnickname=($grup.mailnickname.Replace(' ',''))} -Credential $cred -PassThru
       }

No comments:

Post a Comment