Hello Everyone,
I'm not big on scripts, but was wondering if there is a vb script I could use to scan my AD domain for accounts that will expire in a set amount of days? (ex. 30, 15, or 7 days) I would then like to export it to a text file. I found the below script in the
repo, but it looks to be for a single user. Can it be modified to do what I need?
On Error Resume Next Set objUser = GetObject _ ("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com") dtmAccountExpiration = objUser.AccountExpirationDate If Err.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
G14TS