【问题标题】:Get-MailboxPermissions cmdlet not working/recognisedGet-MailboxPermissions cmdlet 无法工作/无法识别
【发布时间】:2015-05-28 18:05:33
【问题描述】:

大家好 Stackoverflow,

我一直在尝试使用 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

我做错了什么?!

【问题讨论】:

  • 这个答案有帮助吗:stackoverflow.com/a/12748293/419
  • 不确定此 cmdlet 与哪个 RBAC 角色相关联,但是当您执行 Import-PSSession 时,您将获得一个针对您所属的 RBAC 角色定制的功能模块。如果您不是允许查​​看这些权限的 RBAC 角色,您将无法使用该 cmdlet。

标签: powershell exchange-server cmdlets cmdlet


【解决方案1】:

我发现我没有获取这些 cmdlet 的正确权限,这要感谢 mjolinor 为我指明了正确的方向(不知道为什么我一开始没有考虑到这一点)。

不确定此 cmdlet 与哪个 RBAC 角色相关联,但是当您 做那个 Import-PSSession,你会得到一个定制的功能模块 到您所属的 RBAC 角色。如果您不是 RBAC 角色 允许查看那些您没有该 cmdlet 可用的权限。 – mjolinor 9 小时前

【讨论】:

    【解决方案2】:

    使用此命令启用交换功能:

    add-pssnapin *exchange* -erroraction SilentlyContinue
    

    然后使用 Get-Mailbox 命令。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-22
      • 2021-05-11
      • 2020-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多