Const ADS_PROPERTY_UPDATE = 2
' multiple users
Set objOU = GetObject("ldap://cn=Users,dc=king,dc=com,dc=tw/")
' Filter on user objects.'objOU.Filter = Array("user")
' Enumerate user objects.
For Each objUser In objOU
'msgbox("name:"+objUser.name)
On Error Resume Next
objUser.Put "AccountDisabled", True
' Save changes.
objUser.SetInfo
Next
msgbox("Finished!")
若尋找單一 帳號, 可用
Set oUser = GetObject("WinNT://simplo-tw/brian_chang,user")
msgbox(oUser.AccountDisabled)
'True 表示帳號停用狀態中
May 6, 2008
將 AD 帳號全部 disabled
Subscribe to:
Post Comments (Atom)
0 意見:
Post a Comment