Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Prompt for mailbox & Trustee UPN to add / remove “Full Access/SendAs/SendonBehalf ” Permissions

$
0
0

Currently we've been using below code to add SendAs/Full Access permissions on mailbox list stored in $MBXS ( input file taken from csv ), limitation is - we have to supply Trustee user by editing script each time ( e.g. –Trustee John@mydomain.com ) ... could someone please suggest a way that prompts us enter mailbox & user's UPN / Name on the go when script is executed with reference to below code ?    


$MBXS = Get-Recipient -RecipientType UsermMilbox ForEach ($MBX in $MBXS) { Add-RecipientPermission $MBX.name -AccessRights SendAs –Trustee John@mydomain.com -Confirm:$False

Add-MailboxPermission $MBX.name -User John -AccessRights FullAccess -InheritanceType All -Confirm:$False

} Get-RecipientPermission | Where {($_.Trustee -ne 'nt authority\self') -and ($_.Trustee -ne 'Null sid')} }



Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>