list the date that a user account expires

G

Guest

hi
im trying list the date that a user account expires...ihave this code, but i
got an error in the LDAP

<job id="expi">
<script language="VBScript">
On Error Resume Next
Set objUser = GetObject _
("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com")

dtmAccountExpiration = objUser.AccountExpirationDate

If Error.Number = -2147467259 Or dtmAccountExpiration = "1/1/1970" Then
WScript.Echo "No account expiration date specified"
Else
WScript.Echo "Account expiration date: " & objUser.AccountExpirationDate
End If

</script>
</job>

somebody knows how can i fix it??? thanks
 
G

gs

looks like an Microsoft example domain, organization you pulled from some ms
demo scripts.

replace the domain, ou and computer with you real ones
cn=whatYouHave, ou=YourOrgUnit,dc=YourDomainController,
dc=whateveritShouldBe
if your Domain is myCompany.com then
you have dc=myCompany,dc=com

so on....
 

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