Kategorien
Scripte

How do I view Active Directory data?

Binäre Darstellung

Active Directory Domain Info ermitteln

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

Von Michael

Diplom-Ingenieur
wohnhaft in München

Schreiben Sie einen Kommentar

Ihre E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert