April 26, 2016

PowerShell - Find out Shared Mailboxes with enabled AD account

Get-Mailbox | where {$_.RecipientTypeDetails -like "SharedMailbox"} | foreach {Get-ADUser -Identity $_.name} | where {$_.enabled -like "True"} | select UserPrincipalName,Enabled

No comments:

Post a Comment