【问题标题】:How to use AD groups to assign O365 mailbox sizes如何使用 AD 组分配 O365 邮箱大小
【发布时间】:2018-03-23 07:10:23
【问题描述】:

有没有办法做到以上几点?我已经成功地遵循了以下链接,但我们希望根据用户的角色设置不同的限制。

The aforementioned link

在哪里说: 可以将其他筛选器应用于 Get-Mailbox cmdlet 或 Get-User cmdlet,以控制对其应用更改的用户。以下是一个示例,其中使用三个 cmdlet 将命令过滤到组织的销售部门:

Get-User | where {$_.Department -eq "Sales"} | Get-Mailbox | Set-Mailbox -ProhibitSendQuota < Value > -ProhibitSendReceiveQuota < Value > -IssueWarningQuota < Value > 

有点让我困惑,它从哪里拉出“销售”组?

这里可能是个布偶,但感谢您的帮助。

【问题讨论】:

    标签: powershell active-directory office365


    【解决方案1】:

    您可以使用 Active Directory PowerShell 模块执行此操作:

    Get-ADUser -Filter * -Properties Department | Where-Object { $_.Department -eq "Sales" } | [...]
    

    但这只是在吸引所有人并查看 Active Directory 中的部门字段。这是文章给出的示例,但它没有回答您关于基于组分配配额的问题。

    根据您的问题,我怀疑您想要的是:

    Get-ADGroupMember -Identity $GroupName | Get-ADUser | Get-MailBox | Set-ProhibitSendQuota [...]
    

    我不知道你是否需要Get-ADUser 或者Get-ADGroupMember 的输出是否可以直接通过管道传送到Get-MailBox。我不再管理 Exchange,因此我无法再访问这些 cmdlet。 $GroupName 可以是组名、专有名称,甚至是 SID、IIRC。

    【讨论】:

    • Get-User 是 Microsoft cmdlet,因此您可以撤回缺少测试代码的指控;它在您连接到 Exchange Online 或 Exchange Server 2016 的远程会话时可用。请参阅Technet。此外,Department 是 Get-User 的返回对象上的一个属性(至少在 RecipientType 为“UserMailbox”时)。
    • @Robin 嗯,很公平。就像我说的,我很久没有管理 Exchange。为了给你一个想法,我上次这样做时我们仍在使用Get-QADUser
    • @BaconBits 害怕它不会让我通过管道传递给它:/“输入对象不能绑定到命令的任何参数,因为命令不输入或输入和它的属性不匹配任何接受管道输入的参数。+ CatergoryInfo : InvalidArgument: (CN=Firstname Lastname,........DC=Local:PSObject) [Get-Mailbox], ParameterBindingExeception +FullyQuallifiedErrorId : InputObjectNotBound, Get-Mailbox "
    • @DavidGolding Get-ADGroupMember -Identity $GroupName | Select-Object -ExpandProperty DistinguishedName | Get-Mailbox | Set-ProhibitSendQuota [...]Get-ADGroupMember -Identity $GroupName | ForEach-Object { Get-Mailbox -Identity $_.DistinguishedName | Set-ProhibitSendQuota [...] } 怎么样
    • 嗨 @BaconBits 仍然无法正常工作,有没有办法让 Powershell 从文本文件中读取。我可以用 1stname.lastname 填充它吗?
    猜你喜欢
    • 1970-01-01
    • 2020-05-22
    • 2021-03-10
    • 1970-01-01
    • 2021-01-03
    • 1970-01-01
    • 1970-01-01
    • 2013-03-08
    • 2011-09-12
    相关资源
    最近更新 更多