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?!
Use this command to enable exchange functionality:
add-pssnapin *exchange* -erroraction SilentlyContinue
Then use the Get-Mailbox command.