Solved

Powershell / Quest commandLets script that will give output of all servers and pc's in a domain by OS

Posted on 2011-09-30
3
500 Views
Last Modified: 2012-08-14
Powershell / Quest commandLets script that will give output of all servers and pc's in a domain filtered by OS and export to CSV file.  IE: os=NT, XP, Windows 7, 2000, 2003, 2008
0
Comment
Question by:mjm21
3 Comments
 
LVL 35

Accepted Solution

by:
Joseph Daly earned 167 total points
ID: 36893165
Try this.

get-qadcomputer * | select-object name,operatingsystem | sort-object operatingsystem | export-csv c:\file.txt
0
 
LVL 3

Assisted Solution

by:LindyS
LindyS earned 167 total points
ID: 36893194
Get-QADComputer -searchroot 'domain.name' | Select Name,OSName, OSVersion,ParentContainer | Export-CSV C:\temp\Computers.csv -notype -unicode

There are other fields you can export, but this is a basic starting point.

You will need the Quest Active Roles addin for this to work correctly though.
0
 
LVL 39

Assisted Solution

by:Krzysztof Pytko
Krzysztof Pytko earned 166 total points
ID: 36893807
Out of points please

Guys provided you a solution. Just import the output into Excel and use auto filter to filter OS out.

But you may wish to use other syntax to export only computers with particular OS type. Using PowerShell you can use a switch -LDAPFilter

Get-QADComputer -LDAPFilter "&(&(objectClass=Computer)(objectCategory=Computer)(operatingSystem="Windows XP Professional"))" | Select name | Export-CSV c:\WinXP.csv

And change operatingSystem value to another:
Windows Server 2008*
Windows 7*

Or use simply DS Tools

Dsquery * -filter "&(&(objectClass=Computer)(objectCategory=Computer)(operatingSystem="Windows Server 2008*"))" -attr name >>c:\2008.txt

Regards,
Krzysztof
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
A brief introduction to what I consider to be the best editor for PowerShell.
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 to another domain controller. Log onto the new domain controller with a user account t…
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 …

895 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

16 Experts available now in Live!

Get 1:1 Help Now