What are the DS commands?

New DS (Directory Service) Family of built-in command line utilities for Windows Server 2003 Active Directory A: 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: DSadd - add Active Directory users and groups

DSmod - modify Active Directory objects

DSrm - to delete Active Directory objects

DSmove - to relocate objects

DSQuery - to find objects that match your query attributes

DSget - list the properties of an object

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