Set oUser = GetObject("LDAP://cn=locked out user,cn=Users,DC=domain,DC=com")
if oUser.IsAccountLocked then
WScript.Echo "User is locked out"
else
WScript.Echo "User is not locked out"
end if
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.