bsbgolf
asked on
Powershell Script - Disabled Users w/Mailboxes
Does anyone have a simple way to create a powershell or other type of script to generate list (export to .CSV) that will list all disabled users with mailboxes?
This is an Win2008 domain using Exchange 2007.
Thanks,
Bg
This is an Win2008 domain using Exchange 2007.
Thanks,
Bg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I believe it does in 2007.
ASKER
bepsoccer1,
You script did work. Can I add the default email SMTP address and show if the mailbox is being forwarded to another mailbox to that query as well? That would help designate if we have already moved the default to another user or forwarded all email?
Thanks,
Bg
You script did work. Can I add the default email SMTP address and show if the mailbox is being forwarded to another mailbox to that query as well? That would help designate if we have already moved the default to another user or forwarded all email?
Thanks,
Bg
You can change your where to
So the final may look something like this.
{$_.UserAccountControl -Match "AccountDisabled" -and $_.ForwardingAddress -eq $null}
if you want to filter out mailboxes that have been forwarded. And to show the primary email addres you can add
select Name,Database,UserAccountControl,PrimarySmtpAddress
to the line.So the final may look something like this.
Get-Mailbox | where {$_.UserAccountControl -Match "AccountDisabled" -and $_.ForwardingAddress -eq $null}| select Name,Database,UserAccountControl,PrimarySmtpAddress | export-csv c:\disbaledMailboxes.csv -notype
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
get-aduser -disabled -includedproperties msexchaddressbookflags| where {$_.msexchaddressbookflags