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

(c) 2016 www.fedenko.info - Vyacheslav Fedenko