Category Archives: command

How to check Active directory replication for multiple Domain Controllers

To check Active directory the replication for multiple Domain Controllers

Normally repadmin /showreps command has been used to get the replication status for an particular Domain Controller, let say I want to check the Active directory the replication for multiple Domain Controllers, you can use the below command

for /f %a in (list.txt) do repadmin [Continue reading]

To get the members status from the active directory group

In any environment if the employee leaves the company you have to disable the user account in active directory, all the disabled users are still there in the Distribution list and security groups and have to remove the disabled user account manually

If you want to know all the disabled users from the active directory … [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]

Force active directory replication(Force AD replication)

How do I synchronize/Force AD replication between two domain controllers in a Domain, normal AD replication is scheduled however some time we require to synchronize manually

There is many ways to do this we will see one by one

Also Read: Force DFS Replication/Force DFSR Members to Replicate on windows server 2008 and 2012

Force active directory replication / Force

[Continue reading]

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 file (list.txt) there
Example: if … [Continue reading]

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 appname
ex: runas /user:jeffk cmd.exe

Remote Desktop into Console of specific computer

Mstsc /v:computername /console
Ex: mstsc /v:deserver /console

Map a network Drive

Net use drivename: \servershare
Net use z: \daservermusic

Force [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]