Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
Medium Priority
?
536 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 35

Accepted Solution

by:
Joseph Daly earned 668 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 668 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 664 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

618 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