1.查询所有MaxSendSize和MaxReceiveSize值均为unlimited的用户:
Get-Mailbox -Resultsize Unlimited | Where-Object{$_.MaxSendSize -eq "unlimited" -and $_.MaxReceiveSize -eq "unlimited"} | Select-Object DisplayName,MaxSendSize,MaxReceiveSize
2.查询所有MaxSendSize或MaxReceiveSize值为unlimited的用户:
Get-Mailbox -Resultsize Unlimited | Where-Object{$_.MaxSendSize -eq "unlimited" -or $_.MaxReceiveSize -eq "unlimited"} | Select-Object DisplayName,MaxSendSize,MaxReceiveSize
3.Get出所有MaxSendSize和MaxReceiveSize值均为unlimited的用户,并把这些用户批量设置MaxSendSize,MaxReceiveSize 值为10MB
Get-Mailbox -Resultsize Unlimited | Where-Object{$_.MaxSendSize -eq "unlimited" -and $_.MaxReceiveSize -eq "unlimited"} | Set-Mailbox -MaxSendSize 10Mb -MaxReceiveSize 10Mb
4.Get出所有MaxSendSize或MaxReceiveSize值为unlimited的用户,并把这些用户批量设置MaxSendSize,MaxReceiveSize 值为10MB
Get-Mailbox -Resultsize Unlimited | Where-Object{$_.MaxSendSize -eq "unlimited" -or $_.MaxReceiveSize -eq "unlimited"} | Set-Mailbox -MaxSendSize 10Mb -MaxReceiveSize 10Mb
5.Get出所有用户的邮箱,然后再把这些用户批量设置MaxSendSize, MaxReceiveSize 值为10MB。
Get-Mailbox | Set-Mailbox -MaxSendSize 10Mb -MaxReceiveSize 10Mb
PS:
1.布尔运算
-and 和
-or 或
-xor 异或
-not 逆
2.Powershell 中的比较运算符
-eq :等于
-ne :不等于
-gt :大于
-ge :大于等于
-lt :小于
-le :小于等于
-contains :包含
-notcontains :不包含