way to list all computers in AD

Posted on 2010-01-03
Last Modified: 2012-06-22
Dear All,

Im looking for a way to list all computers type I have in my domain, the result like:
XP SP1 100
2000 PRO 200

Note: I have 6 domains which I need to know the clients in each of them

Can you help please?

Question by:Arabsoft-ACS
    LVL 57

    Expert Comment

    by:Mike Kline
    Use that same great adfind tool I suggested for the users question last night
    adfind -default -f objectcategory=computer   name operatingsystem -csv >  c:\ComputersOS.csv
    That will give you a csv on your C drive with the machine names and the OS.
    LVL 35

    Expert Comment

    by:Joseph Daly
    Im gonna go with my old standby of the DS series of tools again.

    The queries would be something like this

    windows 2000
    dsquery computer * -filter "(&(objectCategory=computer)(operatingSystem=windows 2000*))"

    windows xp
    dsquery computer * -filter "(&(objectCategory=computer)(operatingSystem=windows xp*))"

    server 2003
    dsquery computer * -filter "(&(objectCategory=computer)(operatingSystem=windows server 2003*))"
    LVL 4

    Expert Comment

    You can also use a web Base application name as ADManager Plus to get the reports of Computer Account in Active Directory forest.
    Its free for 30 days &.

    Chandar Singh

    Author Comment

    I just looking for count of the OS
    XP - 200
    Win2000 - 462

    Just Count

    Author Comment

    Dear mkline71,

    The result appear like:
    CN=ZAJIL,CN=Computers,DC=noce,DC=com,"ZAJIL","Windows Server 2003"

    is there a way to make better than this, like

    ComputerName                           OS
    Zajil                                    windows 2003

    Also, is there a way to count the result:
    windwos 2003 ---- 512 computers

    LVL 57

    Expert Comment

    by:Mike Kline
    adfind -default -f objectcategory=computer   name operatingsystem -csv -nodn  >  c:\ComputersOS.csv
    Try that to get rid of the DN, and open it using excel.
    No way to get the count like that but if you do something like
    adfind -default -f  "&(objectcategory=computer)(operating system= Windows Server 2003)"  -c
    That will give you a count of Windows server 2003 machines (-c switch is for count in adfind)

    Author Comment

    I try this

    adfind -default -f  "&(objectcategory=computer)(operating system= Windows Server 2003)"  -c

    the result:
    0 Objects returned

    Sure i have a lot of windows 2003
    LVL 17

    Accepted Solution

    Best Way is create 3 saved Queries in ADUC

    For XP
    (&(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=Windows XP*)))

    For Win 2000
    (&(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=Windows 2000*)))

    For Win 2003
    (&(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=Windows Server 2003*)))

    To create Saved Queries
    Goto ADUC -> Right Click Saved Queiries -> New -> Query
    Name : XP
    Select "Define Query" -> in find Select "Cutom Search" -> Goto Advanced

    Now Copy paste any of the above query (XP or 2000 or 2003)

    Click OK twice...!

    Follow the process for other Operation system also...!

    Author Comment

    Dear premglitz.

    it's work fine.

    can you please tell me how to check for:
    windows Vista
    windows 7
    windows NT

    LVL 17

    Expert Comment

    by:Premkumar Yogeswaran
    HI Arabsoft-ACS,
    Find the query for the Vista & Windows 7

    (&(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=windows vista*)))

    Windows 7:
    (&(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=windows 7*)))

    am not sure about the Windows NT will let you know soon...!
    LVL 17

    Expert Comment

    by:Premkumar Yogeswaran
    Thanks for the grad and

    Wish you a HAPPY NEW YEAR 2010....!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    At some point in your work you may run into a need to globally assign a specific file type to open using a specific program. I recently was tasked with completing this objective. In my case it was setting the TSV file association to open with Excel.…
    [b]Ok so now I will show you how to add a user name to the description at login. [/b] First connect to your DC (Domain Controller / Active Directory Server) SET PERMISSIONS FOR SCRIPT TO UPDATE COMPUTER DESCRIPTION TO USERNAME 1. Open Active …
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
    This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now