Help with shell command
Hi all, We run Exchange 2007 on Windows 2003 servers. My boss asked me if there is a way to get a list of peoples' email accounts we have created since a certain date. For instance, if we created 5 new accounts since Monday, the list would show those 5 accounts (and maybe the date they were created as well...). Also, if there isn't a way to list the users is there a way to just tell how many accounts have been created since a certain date? Anyway, any help is appreciated.
September 4th, 2009 2:45pm

List of all users created in last 5 days with dates... Get-User -ResultSize Unlimited | Where {($_.WhenCreated -gt (get-date).adddays(-5))} | Select Name, WhenCreated List of all users created in last 5 days with dates and export it to csv...Get-User -ResultSize Unlimited | Where {($_.WhenCreated -gt (get-date).adddays(-5))} | Select Name, WhenCreated | Export-CSV C:\User.csv Number of users created in last 5 days...Get-User -ResultSize Unlimited | Where {($_.WhenCreated -gt (get-date).adddays(-5))} | Measure-Object | Select Object Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
September 4th, 2009 3:17pm

This is great, one question though. Is there anyway to make the script show only users who have email accounts?
September 4th, 2009 3:40pm

You mean who have mailboxes on Mailbox server... Just replace Get-User with Get-Mailbox in Amit's Commands... Thanks.Vishal Ramnani | MCITP - Exchange 2007 | MCSE Messaging | MCTS - Win 2008 Config
Free Windows Admin Tool Kit Click here and download it now
September 4th, 2009 3:57pm

Add -and ($_.RecipientType -eq "UserMailbox") into Where filter as like below... Get-User -ResultSize Unlimited | Where {($_.WhenCreated -gt (get-date).adddays(-5)) -and ($_.RecipientType -eq "UserMailbox")} | Select Name, WhenCreated Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
September 4th, 2009 4:02pm

You are the man.
Free Windows Admin Tool Kit Click here and download it now
September 4th, 2009 4:40pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics