This will create C:\FileName.xls - an Excel spreadsheet with Names and
Expiration Dates for for all accounts in 'Domain' with and expiration
date set.

----Snip----
On Error Resume Next

Dim Domain
Dim DomainName
Dim UserAccount
Dim Flags
Dim FileName
Dim FSO
Dim MyFile

FileName = "C:\FileName.xls"
DomainName ="Domain"

Set FSO = CreateObject("Scripting.FileSystemObject")
Set MyFile = FSO.CreateTextFile(FileName, True)
Set Domain = GetObject("WinNT://" & DomainName)

For Each UserAccount in Domain
        MyFile.WriteLine UserAccount.Name & vbTab &
UserAccount.AccountExpirationDate
Next
----Snip----

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kern, Tom
Sent: Wednesday, January 05, 2005 4:09 PM
To: ActiveDir (E-mail)
Subject: [ActiveDir] expiring accounts

when a user quits or leaves, i began expiring the account rather than
disabling it because exchange rus keeps querying disabled accounts for
exchangeguid attribute and i think that puts a load on exchange and
fills up the event log.
my question is, when you expire an account, there is no nice reflection
of that in the aduc gui. it just looks like a normal account.
does anyone know how i can query all the accounts in my domain to see
which have expired?
thanks
List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive:
http://www.mail-archive.com/activedir%40mail.activedir.org/
List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to