Created
March 30, 2018 00:59
-
-
Save tostka/9813a267723c4f83fbe80d1735ac68fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$whatif=$true ; | |
$spltMbxGrant=@{ | |
Identity="TARGETMAILBOX" ; | |
User="GRANTEE" ; | |
AccessRights="FullAccess"; | |
whatif=$($whatif); | |
}; | |
write-verbose "Running whatif test of add-MailboxPermission with following parameters" ; | |
$spltMbxGrant.whatif=$true ; | |
$spltMbxGrant | out-string ; | |
add-exomailboxpermission @Grantsplat ; | |
write-verbose "EXECUTING CHANGE:" ; | |
if(!$whatif){$spltMbxGrant.whatif=$false} ; | |
add-exomailboxpermission @Grantsplat ; | |
write-verbose "Updated Permissions:" ; | |
Get-exoMailboxPermission -Identity $spltMbxGrant.Identity |?{$_.User -match '^DOMAIN\\.*'} | select User,AccessRights,IsInherited,Deny | out-string| format-table -wrap ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment