Account Expiration info

  • Thread starter Thread starter Rod Harrison
  • Start date Start date
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.
 
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
 
Could that work by using parameters?
Say like using,

Set objUser = GetObject
("LDAP://cn=%username%,ou=administrators,dc=cis,dc=ubalt,dc=edu")
 
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
 
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.
 
Back
Top