Several methods of Powershell Get Domain Group

Source: Internet
Author: User

Introduction to group Common properties:

First, Get-adgroup get the group (the following example loops to get the group's send permission)

#Send permissions for groups info$groups=get-adgroup-Filter*-searchscope Subtree-searchbase"ou=xx,ou=xx,dc=xx,dc=xx,dc=xx" #Get group name$export[Email protected]()foreach($group inch $groups)    {    $groupname=$group. sAMAccountName$disgroup=get-distributiongroup-identity$groupname    $DisplayName=$disgroup. DisplayName$ou=$disgroup. OrganizationalUnit$OnlyFrom=$disgroup. Acceptmessagesonlyfrom#loop to get a list with group send permissions    foreach($member inch $OnlyFrom)        {        $name=$member. RDN$info=new-Object PsObject$info| Add-member-membertype Noteproperty-name Groupname-value$groupname        $info| Add-member-membertype Noteproperty-name Displayname-value$DisplayName        $info| Add-member-membertype Noteproperty-name Ou-value$ou        $info| Add-member-membertype Noteproperty-name Name-value$name        $export+=$info        #Loop get information about a person sending a permission list        }    }$export| Export-csv D:\ps\groupinfol.csv-Encoding utf8-notypeinformation

Several methods of Powershell Get Domain Group

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.