La Référence Absolue sur les Technologies Microsoft




Afficher la stratégie de mot de passe du domaine

Accueil > Script > active_directory > Afficher la stratégie de mot de passe du domaine

Afficher la stratégie de mot de passe du domaine

Par Joachim GOMARD, LABORATOIRE SUPINFO DES TECHNOLOGIES MICROSOFT
Publiée le 22/10/2004 vers 12h.

Description :
Voici coment obtenir la liste des informations sur la stratégie de mot de passe de votre domaine :

Script :
Const MIN_IN_DAY = 1440
Const SEC_IN_MIN = 60
Set objDomain = GetObject("WinNT://Nom du domaine")
Set objAdS = GetObject("LDAP://dc=Nom du domaine,dc=msft")
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 must manually unlock locked accounts"
End If
WScript.Echo "maxPwdAge = " & intMaxPwdAgeDays
WScript.Echo "minPwdAge = " & intMinPwdAgeDays
WScript.Echo "minPwdLength = " & intMinPwdLength
WScript.Echo "pwdHistoryLength = " & intPwdHistoryLength
WScript.Echo "pwdProperties = " & intPwdProperties
WScript.Echo "lockOutThreshold = " & intLockoutThreshold
WScript.Echo "lockOutObservationWindow = " & intLockOutObservationWindowMinutes
WScript.Echo "lockOutDuration = " & intLockoutDurationMinutes

Proposer un script

Notre avis :

Votre avis :

Réactions :
0

Votants :
12

Visites :
18204

1
2
3
4
5




Retrouvez ci-dessous les autres sections du Laboratoire Microsoft