Directory Services

 

DS family of Command Line Tools for Windows 2003

New DS built-in tools for Windows Server 2003

The DS (Directory Service) group of commands are split into two families.  In one branch are DSadd, DSmod, DSrm and DSMove and in the other branch are DSQuery and DSGet.

When it comes to choosing a scripting tool for Active Directory objects, you really are spoilt for choice.  The the DS family of built-in command line executables offer alternative strategies to CSVDE, LDIFDE and VBScript.

Let me introduce you to the members of the DS family:

DS Syntax

These DS tools have their own command structure which you can split into five parts:

   1      2                    3                                        4         5
Tool object  "DN" (as in LDAP distinguished name)   -switch value  For example:
DSadd user  "cn=billy, ou=managers, dc=cp, dc=com" -pwd cX49pQba

This will add a user called Billy to the Managers OU and set the password to cx49Qba

Here are some of the common DS switches which work with DSadd and DSmod
 -pwd (password) -upn (userPrincipalName) -fn (FirstName) -samid (Sam account name).

The best way to learn about this DS family is to logon at a domain controller and experiment from the command line.  I have prepared examples of the two most common programs.  Try some sample commands for DSadd.

˚

Two most useful Tools: DSQuery and DSGet

The DSQuery and DSGet remind me of UNIX commands in that they operate at the command line, use powerful verbs, and produce plenty of action.  One pre-requisite for getting the most from this DS family is a working knowledge of LDAP.

If you need to query users or computers from a range of OU's and then return information, for example, office, department manager.  Then DSQuery and DSGet would be your tools of choice.  Moreover, you can export the information into a text file.

Check out DSQuery, you will not be disappointed.

How have these DS tools been received?

These DS tools are new in Windows Server 2003.  My own view is that if you regularly need to add, or modify a FEW users, groups or computers, then the DS commands are an alternative to the Active Directory Users and Computers snap-in.  As yet, I have not found a way of using DS commands to bulk import users.  In this respect DS suffers from the same weakness as LDIFDE, there seems to be no mechanism to use a For.... Next loop.  Now if you know different, you have a bulk import solution for DS, then please let me know.

On my travels, I have found mixed reactions to DS commands, while some say there are better ways of creating users, others tell me: 'DSmod is great little utility for a quick change to a user'.  If you like command line utilities then you will like the DS family.  If you prefer menu driven programs then stick with Active Directory Users and Computers.


See Also

^


Google
Web  This website

Solarwinds IpMonitorIs Your Server Running Slowly?

Check with SolarWinds ipMonitor

Analyze your network with ipMonitor.  Get a free evaluation copy, and monitor the performance of the servers on your network.
Free Download of SolarWinds ipMonitor