SharePoint2007でグループの表示名を変更

SharePoint2007では、AD側を変更してもグループの表示名が変更されません。
これは、そういう仕様のため、今後も対応されません。
運用者としてそれでは、困るので、手動でAD側の表示名と一緒にするスクリプトを作成しました。
一応すべてのサイトコレクションを一通り更新します。
SharePointの構成によっては、適合しない場合がありますので注意してください。
あえて、PowerShell、あえて手動ですw

$objGroup = [ADSI]("LDAP://CN="+$cn+",OU=Groups,DC=hoge,DC=com")
#check member : Get-Member

%{[void][Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Culture=Neutral, PublicKeyToken=71e9bce111e9429c")}
$site = New-Object -TypeName Microsoft.SharePoint.SPSite -ArgumentList http://moss.hoge.com
$group = $site.RootWeb.SiteUsers[[String]::Format("HOGE\{0}",$cn)]
if ($group -eq $null)
{
  Write-Host "該当のグループがみつかりません。" -foregroundcolor red
  exit
}
%{[void]$sb.AppendLine("")}
%{[void]$sb.AppendLine("")}
%{[void]$sb.AppendLine("以下の情報に変更します。")}
%{[void]$sb.AppendLine("")}
%{[void]$sb.AppendLine([String]::Format("コード : {0}",$cn))}
%{[void]$sb.AppendLine([String]::Format("変更前 : {0}",$group.Name))}
%{[void]$sb.AppendLine([String]::Format("変更後 : {0}",$objGroup.displayName.ToString()))}
Write-Host $sb.ToString()
%{[void]$sb.AppendLine("")}
Write-Host "よろしければYを入力してください。(Y/n): " -NoNewLine  -foregroundcolor yellow

$ret = $host.UI.ReadLine()
if ($ret -ne "Y")
{
  exit
}
%{[void]$sb.AppendLine("")}
%{[void]$sb.AppendLine("")}

$webApp=$site.WebApplication
foreach ($siteCol in $webApp.Sites)
{
  $site1 = New-Object -TypeName Microsoft.SharePoint.SPSite -ArgumentList $siteCol.Url
  $group1 = $site1.RootWeb.SiteUsers[[String]::Format("HOGE\{0}",$cn)]
  if ($group1 -ne $null)
  {
    $oldValue=$group.Name
    $group.Name = $objGroup.displayName.ToString()
    $group.Update()
    $message=[String]::Format("{0}を更新しました。old:{1}",$siteCol.Url,$oldValue)
    Write-Host $message -foregroundcolor yellow 
  }else{
    $message=[String]::Format("{0}:なし",$siteCol.Url)
    Write-Host $message -foregroundcolor green
  }
}