Je travaille avec un AD 2003. J'ai besoin de modifier une liste de compte
utilisateur. La modification consiste en :
* Décocher l'option "Password never expired"
* Décocher "Password must be changed on next logon"
Le reste des options ne doit pas être modifié.
Comment puis-je faire ces modification en script ?
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Anthony Houssa
Bonsoir,
Je vous conseille de vous inspirer des scripts suivants du Microsoft Script center (l'édition portable peut être téléchargée ici: http://www.microsoft.com/downloads/details.aspx?FamilyID´cb2678-dafb-4e30-b2da-b8814fe2da5a&DisplayLang=en): "Modify a Local User Account Password So It Never Expires" et "Enable Users to change their password". (j'ai copié les exemples ci-dessous)
Pour des informations plus complètes concernant les descripteurts de sécurité, je vous conseille de télécharger l'excellent white paper de Microsoft (malheureusement uniquement disponible en Anglais): "Scripting Security descriptors" http://www.google.be/url?sa=t&source=web&ct=res&cd=3&vedBAQFjAC&url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2Fa%2F1%2Fa%2Fa1afc045-4b65-4a0a-817c-9110b99f542d%2FScripting_Security_Descriptors.doc&rct=j&q=site%3Amicrosoft.com+ACTIVE+DIRECTORY+security+descriptor++scripting&ei=ZdXdS5jIG4bt-AaWlpWKBw&usg¯QjCNH9eUJIoDE6_INTijKu9XwnmhId_w
Bien à vous, Anthony Houssa _____________________________________________________________________
"Modify a Local User Account Password So It Never Expires"
Set objUser = GetObject _ ("LDAP://cn=myerken,ou=management,dcúbrikam,dc=com") Set objSD = objUser.Get("nTSecurityDescriptor") Set objDACL = objSD.DiscretionaryAcl arrTrustees = Array("nt authorityself", "everyone")
For Each strTrustee In arrTrustees For Each ace In objDACL If(LCase(ace.Trustee) = strTrustee) Then If((ace.AceType = ADS_ACETYPE_ACCESS_DENIED_OBJECT) And _ (LCase(ace.ObjectType) = CHANGE_PASSWORD_GUID)) Then objDACL.RemoveAce ace End If End If Next Next
Je travaille avec un AD 2003. J'ai besoin de modifier une liste de compte utilisateur. La modification consiste en : * Décocher l'option "Password never expired" * Décocher "Password must be changed on next logon"
Le reste des options ne doit pas être modifié.
Comment puis-je faire ces modification en script ?
Merci de votre aide,
Olivier
Bonsoir,
Je vous conseille de vous inspirer des scripts suivants du Microsoft Script
center (l'édition portable peut être téléchargée ici:
http://www.microsoft.com/downloads/details.aspx?FamilyID´cb2678-dafb-4e30-b2da-b8814fe2da5a&DisplayLang=en):
"Modify a Local User Account Password So It Never Expires" et
"Enable Users to change their password".
(j'ai copié les exemples ci-dessous)
Pour des informations plus complètes concernant les descripteurts de
sécurité, je vous conseille de télécharger l'excellent white paper de
Microsoft (malheureusement uniquement disponible en Anglais): "Scripting
Security descriptors"
http://www.google.be/url?sa=t&source=web&ct=res&cd=3&vedBAQFjAC&url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2Fa%2F1%2Fa%2Fa1afc045-4b65-4a0a-817c-9110b99f542d%2FScripting_Security_Descriptors.doc&rct=j&q=site%3Amicrosoft.com+ACTIVE+DIRECTORY+security+descriptor++scripting&ei=ZdXdS5jIG4bt-AaWlpWKBw&usg¯QjCNH9eUJIoDE6_INTijKu9XwnmhId_w
Bien à vous,
Anthony Houssa
_____________________________________________________________________
"Modify a Local User Account Password So It Never Expires"
Set objUser = GetObject _
("LDAP://cn=myerken,ou=management,dcúbrikam,dc=com")
Set objSD = objUser.Get("nTSecurityDescriptor")
Set objDACL = objSD.DiscretionaryAcl
arrTrustees = Array("nt authorityself", "everyone")
For Each strTrustee In arrTrustees
For Each ace In objDACL
If(LCase(ace.Trustee) = strTrustee) Then
If((ace.AceType = ADS_ACETYPE_ACCESS_DENIED_OBJECT) And _
(LCase(ace.ObjectType) = CHANGE_PASSWORD_GUID)) Then
objDACL.RemoveAce ace
End If
End If
Next
Next
"OlivierT" <OlivierT@discussions.microsoft.com> wrote in message
news:862DC6CF-37B1-4078-85BA-739C2811542F@microsoft.com...
Bonjour,
Je travaille avec un AD 2003. J'ai besoin de modifier une liste de compte
utilisateur. La modification consiste en :
* Décocher l'option "Password never expired"
* Décocher "Password must be changed on next logon"
Le reste des options ne doit pas être modifié.
Comment puis-je faire ces modification en script ?
Je vous conseille de vous inspirer des scripts suivants du Microsoft Script center (l'édition portable peut être téléchargée ici: http://www.microsoft.com/downloads/details.aspx?FamilyID´cb2678-dafb-4e30-b2da-b8814fe2da5a&DisplayLang=en): "Modify a Local User Account Password So It Never Expires" et "Enable Users to change their password". (j'ai copié les exemples ci-dessous)
Pour des informations plus complètes concernant les descripteurts de sécurité, je vous conseille de télécharger l'excellent white paper de Microsoft (malheureusement uniquement disponible en Anglais): "Scripting Security descriptors" http://www.google.be/url?sa=t&source=web&ct=res&cd=3&vedBAQFjAC&url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2Fa%2F1%2Fa%2Fa1afc045-4b65-4a0a-817c-9110b99f542d%2FScripting_Security_Descriptors.doc&rct=j&q=site%3Amicrosoft.com+ACTIVE+DIRECTORY+security+descriptor++scripting&ei=ZdXdS5jIG4bt-AaWlpWKBw&usg¯QjCNH9eUJIoDE6_INTijKu9XwnmhId_w
Bien à vous, Anthony Houssa _____________________________________________________________________
"Modify a Local User Account Password So It Never Expires"
Set objUser = GetObject _ ("LDAP://cn=myerken,ou=management,dcúbrikam,dc=com") Set objSD = objUser.Get("nTSecurityDescriptor") Set objDACL = objSD.DiscretionaryAcl arrTrustees = Array("nt authorityself", "everyone")
For Each strTrustee In arrTrustees For Each ace In objDACL If(LCase(ace.Trustee) = strTrustee) Then If((ace.AceType = ADS_ACETYPE_ACCESS_DENIED_OBJECT) And _ (LCase(ace.ObjectType) = CHANGE_PASSWORD_GUID)) Then objDACL.RemoveAce ace End If End If Next Next
Je travaille avec un AD 2003. J'ai besoin de modifier une liste de compte utilisateur. La modification consiste en : * Décocher l'option "Password never expired" * Décocher "Password must be changed on next logon"
Le reste des options ne doit pas être modifié.
Comment puis-je faire ces modification en script ?