Quote:
“ |
Originally Posted by thetokyoproject
just wanted to know how to work out how many active users and computers there are in a domain via AD?
Cheers.
|
” |
The DSQUERY command queries Active Directory for objects that match a specific criteria
set. The command’s basic syntax is:
dsquery object_type [{StartNode | forestroot | domainroot}] [-o {dn | rdn | samid}] [-scope {subtree | onelevel | base}] [-name Name] [-desc Description] [-upn UPN] [-samid SAMName] [-inactive NumberOfWeeks] [-stalepwd NumberOfDays] [-disabled] [{-s Server | -d Domain}] [-u UserName] [-p {Password | *}]
Keep in mind, this command will often be used to generate a list of objects against which you will run other command-line utilities. This is accomplished by piping the output to the second command. For example, the following command line queries Active Directory for a user object with a name starting with “Dan,” pipes the result set to DSMOD, which disables each object in the result set: dsquery user -name Dan* | dsmod user -disabled yes The other utilities accept DNs as their input, which is the default output type as well.
But then a VBscript(you can get that on the net, just google it!) will be much easier because you wont have to deal with the syntax.