2015-03-25 52 views
0

嗨#1人,獲取-MailboxPermissions cmdlet將不工作/認可

我一直在嘗試使用Get-MailboxPermission cmdlet來運行我的所有郵箱的報告。我已經運行了這段代碼(很多次)

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

這給了我其他的cmdlet,比如Get-Mailbox。我試圖運行命令時收到的消息如下

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 

我在做什麼錯了?

+0

此答案幫助:http://stackoverflow.com/a/12748293/419 – Kev 2015-03-25 11:44:00

+0

不確定此cmdlet與哪個RBAC角色相關聯,但是當您執行Import-PSSession時,您將獲得一個函數模塊根據您所屬的RBAC角色進行定製。如果您不在允許查看這些權限的RBAC角色中,則不會有該cmdlet可用。 – mjolinor 2015-03-25 12:30:36

回答

0

想通了,我沒有獲得這些cmdlet的正確權限,這要感謝mjolinor將我指向正確的方向(不知道爲什麼我沒有考慮到這一點)。

不知道這RBAC角色此cmdlet相關聯,但是當你 做進口PSSession時,你會得到的功能模塊定製 你屬於RBAC角色。如果您不在 允許查看這些權限的RBAC角色中,則不會有該cmdlet可用。 - mjolinor 10小時前

0

使用此命令啓用交換功能:

add-pssnapin *exchange* -erroraction SilentlyContinue 

然後使用Get-Mailbox命令。