Get-MailboxPermissions cmdlet not working/recognised

mmagu6 picture mmagu6 · Mar 25, 2015 · Viewed 18.2k times · Source

Hi Stackoverflow people,

I have been trying to use the Get-MailboxPermission cmdlet to run a report on all my mailboxes. I have run this piece of code (many times)

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://Exchange Server/PowerShell/ -Authentication Kerberos -Credential $UserCredential
Import-PSSession $Session

Which has given me othe exchange cmdlets, like Get-Mailbox. The message I receive when trying to run the command is as below

Get-MailboxPermission : The term 'Get-MailboxPermission' is not recognized 

as the name of a cmdlet, function, script file, 
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
again.
At line:1 char:1
+ Get-MailboxPermission
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-MailboxPermission:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

What am I doing wrong?!

Answer

Odysseus Ithaca picture Odysseus Ithaca · Sep 18, 2016

Use this command to enable exchange functionality:

add-pssnapin *exchange* -erroraction SilentlyContinue

Then use the Get-Mailbox command.