檢索 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"