From today onwards we began the actual combat series, first from the ad, followed by the Exchange and Lync Series, the SharePoint family of Coke has long been published, Haha. 1. List members of a group
Get-adgroupmember GroupName | Format-table Name
2. Get security within a domain-universal group
Get-adgroup–ldapfilter "(& (Objectcategory=group) (grouptype:1.2.840.113556.1.4.803:=-2147483640))"- Properties * | Select Name, distinguishedname, Description | Export-csv "Security-universal group. CSV"-notypeinformation-encoding UTF8
3. Get security within a domain-global group
Get-adgroup–ldapfilter "(& (Objectcategory=group) (grouptype:1.2.840.113556.1.4.803:=-2147483646))"- Properties * | Select Name, distinguishedname, Description | Export-csv "Security-global group. CSV"-notypeinformation-encoding UTF8
4. Get security within domains-local domain groups
Get-adgroup–ldapfilter "(& (Objectcategory=group) (grouptype:1.2.840.113556.1.4.803:=-2147483643))"- Properties * | Select Name, distinguishedname, Description | Export-csv "Security-local domain group. CSV"-notypeinformation-encoding UTF8
5. Get members within a group
Get-adgroupmember Csadministrator | Select Name, distinguishedname | Export-csv csadministrator.csv-notypeinformation-encoding UTF8
6. Move users of Group A to Group B
Get-adgroupmember A_group | Select sAMAccountName | ForEach {add-adgroupmember b_group-members $_.samaccountname}