SAM2009
asked on
How to filter result in PowerShell
I run this cmd but need to filter user result:
Get-MailboxPermission -Identity "UserMydomain.com" | ft User, AccessRights
Fo example I don't want to see users contain: "S-1-5-21" or "Domain Admins" or "Exchange Servers"
How can I do that?
Thanks
Get-MailboxPermission -Identity "UserMydomain.com" | ft User, AccessRights
Fo example I don't want to see users contain: "S-1-5-21" or "Domain Admins" or "Exchange Servers"
How can I do that?
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Well you have several options:
$perms = Get-MailboxPermission john.doe| Where-Object {$_.isinherited -eq $false}
$perms.Identity
(Get-MailboxPermission john.doe | Where-Object {$_.IsInherited -eq $false}).identity
Get-MailboxPermission john.doe | Where-Object {$_.IsInherited -eq $false} | Select-Object -ExpandProperty Identity
To name a few.
ASKER
But I want to keep the same info and result format as you suggest in the first answer: User,AccessRights,Identity ,IsInherit ed
Get-MailboxPermission –identity * | fl user, identity, accessrights
Following article contains more options for this command
https://blogs.msdn.microsoft.com/deva/2012/04/15/exchange-server-2007-2010-how-to-query-user-mailboxes-its-permissions-using-exchange-powershell/
Following article contains more options for this command
https://blogs.msdn.microsoft.com/deva/2012/04/15/exchange-server-2007-2010-how-to-query-user-mailboxes-its-permissions-using-exchange-powershell/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the explanations.
In my case the Identity names are all in one line even with Identity.Name. Is there a way to have it separately at least?
In my case the Identity names are all in one line even with Identity.Name. Is there a way to have it separately at least?
Sorry, can't follow you.
Your example retrieves the mailbox permissions for one mailbox with the identity "UserMydomain.com". This is one single identity, and accordingly, there should be one single identity for each ACE listed.
I'm not really an Exchange administrator, and I can't reproduce "Identity names are all in one line even with Identity.Name". You need to elaborate here on the actual command you're using and its output.
Your example retrieves the mailbox permissions for one mailbox with the identity "UserMydomain.com". This is one single identity, and accordingly, there should be one single identity for each ACE listed.
I'm not really an Exchange administrator, and I can't reproduce "Identity names are all in one line even with Identity.Name". You need to elaborate here on the actual command you're using and its output.
ASKER
I have enough info to continu. Thanks to all!
ASKER
Because i got something like this with 3 dots at the end: Shared Mailbox/Lab...