Data Centers

SolutionBase: Using the Dsget command in Windows Server 2003

Most Windows Server 2003 utilities are GUI-based, forcing you to point and click to get work done. Here's how you can use the Dsget utility to access Active Directory information from the command line.

In the article "Using the Dsquery command in Windows Server 2003," I explained how the Dsquery command works and showed you several examples of how to use it to reveal information that would be a bit tricky to get out of GUI interface tools.

In this article, I'll continue my examination of Windows Server 2003's directory service command-line tools with a detailed look at the Dsget command, which, as you'll remember, allows you to display the properties of objects in Active Directory. As I do, I'll show you some examples of how the Dsget command works. I'll also demonstrate how to create some cool command-line scripts by combining the Dsget and Dsquery commands.

The commands

The Dsget command consists of 10 separate subcommands, as shown in Table A. Each of these commands is designed to display the properties of a specific object type in Active Directory. Several of the commands have multiple variations, which I'll describe in more detail in a moment.

Table A

Command Description
Dsget computer Displays the properties of computer accounts. This command has two variations: one that allows you to view the properties of multiple computers and one that allows you to view the membership information of a single computer.
Dsget contact Displays the various properties of contacts.
Dsget group Displays the properties of group accounts. This command has two variations: one that allows you to view the properties of multiple groups and one that allows you to view the membership information of a single group.
Dsget ou Displays the properties of organizational units.
Dsget partition Displays the properties of Active Directory partitions.
Dsget quota Displays the properties of a quota specification, which determines the maximum number of objects a security principal can own in a specific directory partition.
Dsget server Displays the properties of domain controllers. This command has three variations: one that displays the general properties of a domain controller, one that displays the list of security principals that own the largest number of objects on the domain controller, and one that displays the distinguished names of the directory partitions on the server.
Dsget site Displays the properties of an Active Directory site.
Dsget subnet Displays the properties of a subnet.
Dsget user Displays the properties of user accounts. This command has two variations: one that allows you to view the properties of multiple users and one that allows you to view the group membership information of a single user.

About Greg Shultz

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

Editor's Picks

Free Newsletters, In your Inbox