跳至内容
- Get-TransportRule -State Enabled | fl *
- Get-TransportRule -State Enabled | Set-TransportRule -SentToMemberOf ‘Ex-Employee’
- 查看 禁用的AD 用户
- $DisableAduser = Get-ADUser -Filter {Enabled -eq “False” } | select name
- New-DistributionGroup -OrganizationalUnit ‘OU=离职员工,DC=abc,DC=com’ -Name ‘Ex-Employee’ -Type Security
- Get-DistributionGroupMember -Identity Ex-Employee | fl Name
- 查看 特定OU 用户
- $ExEployee01 = Get-ADUser -Filter * -SearchBase “OU=离职员工,DC=abc,DC=com” | Select-Object SamAccountName
- $ExEployee01.SamAccountName | Add-DistributionGroupMember -Identity Ex-Employee
- 查看 分发组(通讯组)
- Get-ADGroup -Filter {GroupCategory -eq ‘Distribution’} | select Name
- 查看 安全组
- Get-ADGroup -Filter {GroupCategory -eq ‘Security’} | select Name