I want a list of disabled accounts with mailbox size

azhar Nasim 0 Reputation points
2023-10-28T20:12:41.67+00:00

I want a list of disabled accounts in active directory with mailbox size, username , email address, last logon time with powershell commands

I am using Exchange Server 2016 and have more than 1000 accounts

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,188 questions
Exchange | Exchange Server | Other
Exchange | Exchange Server | Management
Microsoft 365 and Office | Excel | For business | Windows
Exchange | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kael Yao 37,746 Reputation points Moderator
    2023-10-30T05:43:15.1533333+00:00

    Hi @azhar Nasim

    By "disabled accounts", do you mean disabled AD accounts or disabled mailboxes?

    If it is disabled mailboxes, you can use the following cmdlet in Exchange Management Shell:

    Get-MailboxDatabase | Get-MailboxStatistics | where {$_.DisconnectReason -eq "Disable"} | select DisplayName,TotalItemSize,LastLogonTime | Export-csv C:\temp\disabled_mailbox.csv
    
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.