Category Archives: dsget

Command to Copy Member Of from one Group to another AD Group

Have googled this and didn’t found command/script to copy member of, however found many articles to copy members from a group, though of write a simplified command to achieve this, have already discussed how to copy group membership from one group to another group

Also Read: Display the list of members with nested groups

Source … [Continue reading]

Group SID

Group SID

Some time we require a SID for the group in active directory, using the simple inbuilt windows command we can get the group SID

You can use the below command to find the group SID

Group SID (Group to SID)

Groupname: sales_executes(Pre-Win2k Name)

Syntax:

dsquery group -name “groupname” | dsget group -sid

Example:

dsquery group -name sales_executes | … [Continue reading]

User to SID

Some time we require a SID for the user account in active directory, using the simple inbuilt windows command we can get the User to SID

You can use the below command to find the User to SID

User to SID (Username to SID)

Username: Johnson (Pre-Win2k Name)

Syntax:

dsquery user -name “username” | dsget user -sid

Example:

dsquery user … [Continue reading]

How to add all members of one group to the other group

Command to add members of one group to the other group (Group migration)

If you want to add all the members from group1 to the group2 user the below command

syntex:

dsget group “Source group DN” -members | dsmod group “Destination group DN” -addmbr

Example:

dsget group “CN=Group1,OU=Test,DC=test,DC=com” -members |
dsmod group “CN=Group2,OU=Test,DC=Test,DC=com”
-addmbr

Check the below link to find … [Continue reading]

To display the list of members with nested groups

Members from Nested Group

To display the list of members, recursively expanded

In the below command, you can extract the group membership details, if you have a group that member of this group then this command will extract all the members including the nested groups(group with in the group)

So you will get all the members list form the group, … [Continue reading]

How to verify KCC disabled

How to verify KCC disabled, do you know ISTG is enabled or disabled for you active directory sites, you check the ISTG status using below command

command Verify KCC status on intersite (by default KCC enabled)

dsquery site -name Default-First-Site-Name | dsget site –autotopology

autotopology
no
dsget succeeded

Note: If automatic inter-site topology generation is enabled (yes) or disabled (no).… [Continue reading]

Find the site name for given subnet in AD

Command to Find the site name for given subnet in AD, some time we know the IP and subnet and we have to find the site in active directory, you can use the below command

dsquery subnet -name 192.168.1.0/24 | dsget subnet -site

Subnet = 192.168.1.0/24

Please replece the above subnet with your subnet to get the corresponding site name.… [Continue reading]