unlock user script

J

Jason Higgins

I am trying to write a script that will unlock a user
account using the lockoutTime property. I would like to
use the username in the LDAP path but it is not working.
I have to use the following.

Set oUser = GetObject("LDAP://CN=LastName\,
FirstName,CN=Users,DC=domain,DC=com")

When I replace "CN=LastName\, FirstName"
with "CN=UserName" I get an error that says the object
can't be found. Is it possible to use the UserName in
the LDAP path?
 
M

Matjaz Ladava [MVP]

You can get the right dn of a user object, by opening ADSIEdit, locate user
and read distinguishname attribute.

--
Regards

Matjaz Ladava, MCSE (NT4 & 2000), Windows MVP
(e-mail address removed)
http://ladava.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top