Kategorien
Scripte

Active Directory read Info

Binäre Darstellung

Active Directory Domain Info lesen

Domain Policy Info abfragen, Ausgegeben werden Passwortinformationen und Attribute zur Sicherheit.

Const MIN_IN_DAY = 1440, SEC_IN_MIN = 60
Set objDomain = GetObject("WinNT://domain")
Set objAds = GetObject("LDAP://dc=domain")
Kontrollfeld.Text = ""
intMaxPwdAgeSeconds = objDomain.Get("MaxPasswordAge")
intMinPwdAgeSeconds = objDomain.Get("MinPasswordAge")
intLockOutObservationWindowSeconds = objDomain.Get("LockoutObservationInterval")
intLockOutDurationSeconds = objDomain.Get("AutoUnlockInterval")
intMinPwdLength = objAds.Get("minPwdLength")
intPwdHistoryLength = objAds.Get("pwdHistoryLength")
intPwdProperties = objAds.Get("pwdProperties")
intLockoutThreshold = objAds.Get("lockoutThreshold")
intMaxPwdAgeDays =
 ((intMaxPwdAgeSeconds / SEC_IN_MIN) / MIN_IN_DAY) & " days"
intMinPwdAgeDays =
 ((intMinPwdAgeSeconds / SEC_IN_MIN) / MIN_IN_DAY) & " days"
intLockOutObservationWindowMinutes =
 (intLockOutObservationWindowSeconds / SEC_IN_MIN) & " minutes"
If intLockOutDurationSeconds <> -1 Then
  intLockoutDurationMinutes =
 (intLockOutDurationSeconds / SEC_IN_MIN) & " minutes"
Else
  intLockoutDurationMinutes =
 "Administrator muss manuell gelockte Accounts entsperren"
End If
Kontrollfeld.Text = Kontrollfeld.Text &
"maxPwdAge = " & intMaxPwdAgeDays & vbCrLf
Kontrollfeld.Text = Kontrollfeld.Text &
 "minPwdAge = " & intMinPwdAgeDays & vbCrLf
Kontrollfeld.Text = Kontrollfeld.Text &
 "minPwdLength = " & intMinPwdLength & vbCrLf
Kontrollfeld.Text = Kontrollfeld.Text &
 "pwdHistoryLength = " & intPwdHistoryLength & vbCrLf
Kontrollfeld.Text = Kontrollfeld.Text &
 "pwdProperties = " & intPwdProperties & vbCrLf
Kontrollfeld.Text = Kontrollfeld.Text &
 "lockOutThreshold = " & intLockoutThreshold & vbCrLf
Kontrollfeld.Text = Kontrollfeld.Text &
 "lockOutObservationWindow = " &
intLockOutObservationWindowMinutes & vbCrLf
Kontrollfeld.Text = Kontrollfeld.Text &
 "lockOutDuration = " & intLockoutDurationMinutes & vbCrLf
End Sub