Changing Domain Settings
In the last chapter, I showed you an example of how you can use the WinNT provider to modify a domain's password and lockout policies. Here it is again.
' first bind to the domain
set objDomain = GetObject("WinNT://MyDomain")
objDomain.Put "MinPasswordLength", 8
objDomain.Put "MinPasswordAge", 10
objDomain.Put "MaxPasswordAge", 45
objDomain.Put "PasswordHistoryLength", 8
objDomain.Put "LockoutObservationInterval", 30000
objDomain.SetInfo
This same syntax works pretty well for LDAP connections to a domain, although as I noted in the previous section the attribute names are different. Here's an LDAP version of the same example.
' first bind to the domain
set objDomain = GetObject("LDAP://dc=domain,dc=com")
objDomain.Put "minPwdLength", 8
objDomain.Put "minPwdAge", 10
objDomain.Put "maxPwdAge", 45
objDomain.Put "pwdHistoryLength", 8
objDomain.Put "lockoutObservationWindow", 30000
objDomain.SetInfo
As you can see, the basic syntax is to use the Put method, the appropriate attribute name, and the new value, and then to call the SetInfo method when you're finished. SetInfo copies the changes back to the directory, committing the changes.
|