Category Archives: command

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:… Read More »

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… Read More »

To check the list of Users Group Membership

Check the list of Users Group Membership List I have used “for” command to read the input file (list.txt) and execute the “net user” command for each user and store the result in output.txt file For /f %a in (list.txt) do net user %a /dom >> output.txt Note: run this command from where the input… Read More »

Basic commands

Some of the Basic commands, windows admin’s should know Basic commands View Last Reboot Time net statistics server | more Run a program as another user runas /user:domainusername appnameex: runas /user:jeffk cmd.exe Remote Desktop into Console of specific computer Mstsc /v:computername /consoleEx: mstsc /v:deserver /console Map a network Drive Net use drivename: \servershareNet use z:… Read More »

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… Read More »

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… Read More »