Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

PowerShell Script - Full Access Permissions

$
0
0

We are now running Exchange on Office 365 using a hybrid solution, which means I cannot currently give users full access permissions to shared mailboxes on the online portal. I can however do it through PowerShell.

I have tried writing a script to make this easier going forward but when I run this script (in a .ps1 file)

$shared = read-host "Enter Shared Mailbox Name"
$User = read-host "Enter Full Name of User";

Add-MailboxPermission "$Shared" -User "$User" -AccessRights FullAccess -InheritanceType all

I get the following error:

Add-MailboxPermission : The term 'Add-MailboxPermissionÂ' is not recognized as the name of a cmdlet, function, scri
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correc
and try again.
At C:\scripts\FulLAccess.ps1:4 char:1
+ Add-MailboxPermission "$Shared" -User "$User" -AccessRights FullAccess -Inh ...
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Add-MailboxPermissionÂ:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

When I type the command into the Powershell window manually it adds the permissions no problem at all so I know the command works. Is the syntax correct? I have tried a few variations already.


Any ideas?


Viewing all articles
Browse latest Browse all 15370

Trending Articles



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