Category Archives: dsquery

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 extract the user who has the option Password never expires in the OU

To extract all the users in the OU with the Password never expires details, we can user Dsquery or CSVDE commands

Use the blow command to find and export users with   Password never expires in Active Directory

Dsquery command

dsquery user “OU=Test,DC=test,DC=com” -limit 0 | dsget user -pwdneverexpires >c:tempUsers.txt

dsquery user “OU=Test,DC=test,DC=com” –o rdn -limit 0> c:tempUsers1.txt

Collect this two … [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]