检索 Active Directory 组

Get-ADGroup -Identity "My-First-Group" #Ensure if group name has space quotes are used

检索与组关联的所有属性

Get-ADGroup -Identity "My-First-Group" -Properties *

检索组的所有成员

Get-ADGroupMember -Identity "My-First-Group" | Select-Object -Property sAMAccountName
Get-ADgroup "MY-First-Group" -Properties Members | Select -ExpandProperty Members

将 AD 用户添加到 AD 组

Add-ADGroupMember -Identity "My-First-Group" -Members "JohnSmith"

新 AD 集团

New-ADGroup -GroupScope Universal -Name "My-Second-Group"