networkbike
asked on
PowerShell command to removed unwanted info from an output
When I run the script: Get-MailboxPermission 'Joe Bloggs' | Select User,AccessRights | ft -autosize
I get an output that included a lot of default users such as: Domain Admins, Enterprise Admins, Exchange Domain Servers, Exchange Services etc
How could the list produced be reduced to just normal users. Something like Where-Object {$_.name -NotLike "*Admin"} may work. How would the script look that removed the line containing *Admin* or remove -Like '*Exchange*'. There are also quite a few SIDs being displayed as will so any entry with 'S-1-5' needs to be removed.
The attached text file are the ones I need to go away in the output.
I get an output that included a lot of default users such as: Domain Admins, Enterprise Admins, Exchange Domain Servers, Exchange Services etc
How could the list produced be reduced to just normal users. Something like Where-Object {$_.name -NotLike "*Admin"} may work. How would the script look that removed the line containing *Admin* or remove -Like '*Exchange*'. There are also quite a few SIDs being displayed as will so any entry with 'S-1-5' needs to be removed.
The attached text file are the ones I need to go away in the output.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Looked at some other scripts which had something similar.
Open in new window