mlee
asked on
Exchange mailbox database disabled accounts cmdlet
Hello, I have 10 databases in my Exchange Server, and I'm trying to get only the COUNT of the number of disabled mailboxes in ONE DATABASE. I'm able to get the TOTAL amount of 10 disabled/Active databases total, but I need to get the COUNT of disabled mailboxes PER database. Any ideas how I can get this?
What command are you running? Please provide as a reference.
ASKER
So this cmdlet works but it gets me the TOTAL number of disabled accounts out of all mailbox databases:
(Get-aduser –filter *|where {$_.enabled –eq “True”}).count
This command gets me no output:
Get-MailboxDatabase <Database Name>|Get-MailboxStatistic s |Where {$_.DisconnectReason –eq “Disabled
This command gives output, but only 0:
(Get-MailboxStatistics –Database <Database Name>|where {$_.DisconnectDate –ne $null}).count
I tried this command as well but no output:
foreach ($DB in $DBs) {Get-MailboxStatistics –Database $DB | where {$_.DisconnectDate –ne $null } | select Database.DisplayName.Disco nnectDate, @{n=”Membe rCount”;e= {(Get-Mail boxStatist ics –Database $DB | where { $_.DisconnectDate-ne $null } ).Count}}}
I need to get the COUNT of disabled accounts PER Database. I've been working on this for over a week and still can't figure it out. Any help would be great.
Thanks,
Matt
(Get-aduser –filter *|where {$_.enabled –eq “True”}).count
This command gets me no output:
Get-MailboxDatabase <Database Name>|Get-MailboxStatistic
This command gives output, but only 0:
(Get-MailboxStatistics –Database <Database Name>|where {$_.DisconnectDate –ne $null}).count
I tried this command as well but no output:
foreach ($DB in $DBs) {Get-MailboxStatistics –Database $DB | where {$_.DisconnectDate –ne $null } | select Database.DisplayName.Disco
I need to get the COUNT of disabled accounts PER Database. I've been working on this for over a week and still can't figure it out. Any help would be great.
Thanks,
Matt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.