Sometimes you may find yourself in a situation where you have to export the members of a security group from AD.
In such a situation we can use following commands : (On a server were AD tools - remote Administration tools are installed)
dsquery group -name “Group Name” | dsget group -members > users.csv
However this will give results with the respective LDAP paths
e.g CN=Server01,OU=V,OU=Servers,OU=Computers,OU=Loc,DC=domain,DC=com
You might have only wanted to get the name not the netire path.
Just open the csv file you exported and (Press Ctrl + H ) i.e Find and Replace these 1 by 1
Use Replace All option , the image is shown here:
OU=*
CN=
,
Additionally you may also use the following command:
net group “Group Name” /domain > users.csv
Again you have to do some formatting of the results.
Hope this helps.
In such a situation we can use following commands : (On a server were AD tools - remote Administration tools are installed)
dsquery group -name “Group Name” | dsget group -members > users.csv
However this will give results with the respective LDAP paths
e.g CN=Server01,OU=V,OU=Servers,OU=Computers,OU=Loc,DC=domain,DC=com
You might have only wanted to get the name not the netire path.
Just open the csv file you exported and (Press Ctrl + H ) i.e Find and Replace these 1 by 1
Use Replace All option , the image is shown here:
OU=*
CN=
,
Additionally you may also use the following command:
net group “Group Name” /domain > users.csv
Again you have to do some formatting of the results.
Hope this helps.
Comments
Post a Comment