使用些脚本可以在运行Exchange 2003的计算机中启用电子邮件地址自动更新。
Const ADS_PROPERTY_CLEAR = 1
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
objCommand.CommandText = "<GC://OU=lab,DC=company,DC=com>;(objectCategory=User)" & ";distinguishedName;subtree"
Set objRecordSet = objCommand.Execute
intCounter = 0
While Not objRecordset.EOF
usuario = objRecordset.Fields("distinguishedName")
Set objUser = GetObject ("LDAP://" & usuario & "")
objUser.PutEx ADS_PROPERTY_CLEAR, "msExchPoliciesExcluded" , 0
objUser.SetInfo
objRecordset.MoveNext
Wend
objConnection.Close