Account Expiration info

R

Rod Harrison

Does anyone have a vbs script to query then display the
AcountExpirationDate for a user? I am not looking for password
expiration, but AccountExpirationDate. If someone has one, please post
the code for all to use. Again, I'm looking for something written in a
..vbs format.
 
M

Matjaz Ladava

Copy&Paste this to notepad and save it with vbs extension

Set objUser = GetObject ("LDAP://cn=user,ou=yourou,dc=domain,dc=com")
WScript.echo objUser.AccountExpirationDate

--
Regards

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

Rod Harrison

Could that work by using parameters?
Say like using,

Set objUser = GetObject
("LDAP://cn=%username%,ou=administrators,dc=cis,dc=ubalt,dc=edu")
 
M

Matjaz Ladava

You use

set oArgs = wscript.Arguments
oArgs(0)
oArgs(1)

so your line should look like

set oArgs = wscript.Arguments
Set objUser = GetObject("LDAP://cn=" + oArgs(0) +
",ou=administrators,dc=cis,dc=ubalt,dc=edu")

This will give you possibility to run your vbs with arguments.

--
Regards

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

Rod Harrison

I have created a batch script which will do this in Windows 2000 AD.
You can contact me at (e-mail address removed) if you are interested
in how I did it.

remove the nospam.
 

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