The specified mailbox "\inbox" doesn't exist.


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”



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

Thank you very much Noam.

I was not sure and you saved me. Thanks again :smiley: