Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  List  userAccountControl  Values  for  an  Active  Directory  User  Account  

 Content of List userAccountControl Values for an Active Directory User Account.vbs
MD5 Hash: 707918A598E4C06FE16C7E422F3E44A6
' Description: Reads values from the userAccountControl of the MyerKen Active Directory user account.


Set objHash = CreateObject("Scripting.Dictionary")

objHash.Add "ADS_UF_SMARTCARD_REQUIRED", &h40000
objHash.Add "ADS_UF_TRUSTED_FOR_DELEGATION", &h80000
objHash.Add "ADS_UF_NOT_DELEGATED", &h100000
objHash.Add "ADS_UF_USE_DES_KEY_ONLY", &h200000
objHash.Add "ADS_UF_DONT_REQUIRE_PREAUTH", &h400000

Set objUser = GetObject _
("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com")
intUAC = objUser.Get("userAccountControl")

If objUser.IsAccountLocked = True Then
Wscript.Echo "ADS_UF_LOCKOUT is enabled"
Else
Wscript.Echo "ADS_UF_LOCKOUT is disabled"
End If
wscript.echo VBCRLF

For Each Key In objHash.Keys
If objHash(Key) And intUAC Then
Wscript.Echo Key & " is enabled"
Else
Wscript.Echo Key & " is disabled"
End If
Next

   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a