Author Posts

November 17, 2015 at 10:04 pm

Hi,

I have this basic powershell script to add a user into another user's inbox. But I receive the following message.

The specified mailbox "\inbox" doesn't exist.
+ CategoryInfo : NotSpecified: (0:Int32) [Add-MailboxFolderPermission], ManagementObjectNotFoundException
+ FullyQualifiedErrorId : F81499EB,Microsoft.Exchange.Management.StoreTasks.AddMailboxFolderPermission

The following is my basic script.
Write-Host "Press 1 to add individual user to read-only access to the inbox"
$question = Read-Host "Please an option"

If ($question -eq '1') {
$MailboxName = Read-Host "What is the mailbox name"
$UserName = Read-Host "What is the username"

Add-MailboxFolderPermission -Identity "$MailboxName:\inbox" -User $UserName -AccessRights Reviewer
Write-Host "$UserName now has right access to the inbox"

}

November 17, 2015 at 11:10 pm

Hi,

I did a some testing in the shell and it seems that the ':' is treated as part of the variable name.

try the following command instead:
Add-MailboxFolderPermission -Identity "$($MailboxName):\inbox" -User $UserName -AccessRights Reviewer

November 18, 2015 at 3:07 pm

Thank you very much Noam.

I was not sure and you saved me. Thanks again 😀