Devre Dışı Kullanıcı Hesaplarını Listeleyin
Ocak 3, 2008 at 7:55 pm | In Windows Vista | Leave a CommentTags: active directory, domain, etki alanı, gökhan şenyüz, komut satırı, script, user account, vbscript, windows server 2003
Gokhan.com Active Directory etki alanı içerisindeki Devre Dışı (Disabled) kullanıcı hesaplarını listeler.
Const ADS_UF_ACCOUNTDISABLE = 2
Set objConnection = CreateObject(”ADODB.Connection”)
objConnection.Open “Provider=ADsDSOObject;”
Set objCommand = CreateObject(”ADODB.Command”)
objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
“<GC://dc=gokhan,dc=com>;(objectCategory=User)” & _
“;userAccountControl,distinguishedName;subtree”
Set objRecordSet = objCommand.Execute
intCounter = 0
Do Until objRecordset.EOF
intUAC=objRecordset.Fields(”userAccountControl”)
If intUAC AND ADS_UF_ACCOUNTDISABLE Then
WScript.echo objRecordset.Fields(”distinguishedName”) & ” is disabled”
intCounter = intCounter + 1
End If
objRecordset.MoveNext
Loop
WScript.Echo VbCrLf & “A total of ” & intCounter & ” accounts are disabled.”
objConnection.Close
No Comments Yet »
Bu yazıya yapılan yorumlar için RSS beslemeleri. URI'nin geri izlemesini yap.
Yorum yapın
WordPress.com'dan blog alın. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.