![]() ![]() Then I just crack open the AllWindows.CSV file in Excel and: Get-ADComputer -Filter * -Property * | Select-Object Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion | Export-CSV AllWindows.csv -NoTypeInformation -Encoding UTF8 Hey, what do you call a million lawyers at the bottom of the ocean? A good start! Why don’t sharks eat lawyers? Professional courtesy! What do have when a lawyer is buried up to his neck in sand? Not enough sand! Haw haw… anyway: With the chaining of an additional pipeline I can find all the computers, select the attributes I find valuable for them, then send them into a comma-separated text file that is even able to read the weirdo UTF-8 trademark characters that lawyers sometimes make us put in AD. I need a way to send all this out to a text file for easier sorting, filtering, and analysis. In all but the smallest domains, though, this will soon get unreadable. So what we’ve done ‘til now was just use PowerShell to send goo out to the screen and stare. ![]() Get-ADComputer -Filter -Property * | Format-Table Name,OperatingSystem,OperatingSystemVersion -Wrap -Auto Now I start breaking down the results with filters. And I still have a Windows 2000 server that is going to move quickly and replace that server. It looks like I have some work to do here – one Windows Server 2003 computer needs Service Pack 2 installed ASAP. It also automatically sizes and wraps the data. The only attributes that the table contains are the computer name, operating system description, service pack, and OS version. It then feeds the data (using that pipe symbol) into a formatted table. This command is filtering all computers for all their properties. As you get comfortable with AD PowerShell, I highly recommend that you start tuning for less data to be returned - the "filter left, format right" model described here by Don Jones. Get-ADComputer -Filter * -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion -Wrap –AutoĪnother important note (thanks dloder): I am going for simplicity and introduction here, so the -Filter and -Property switches are not designed for perfect efficiency. Now I want to pull some data from my domain. Get-Help Get-ADComputer -Full Getting OS information Then if I want to see all the details about using this cmdlet, I run: This command automatically searches for computer objects throughout a domain, returning all sorts of info.Īs I have written about previously my first step is to fire up PowerShell and import the ActiveDirectory module: The cmdlet of choice for inventorying computers through AD is Get-ADComputer. ![]() Have you ever had to figure out what operating systems are running in your domain environment so that you can plan for upgrades, service pack updates, or support lifecycle transitions? Did you know that you don’t have to connect to any of the computers to find out? It’s easier than you might think, and all possible once you start using AD PowerShell in Windows Server 2008 R2 or Windows 7 with RSAT. First published on TechNet on Feb 04, 2010 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |