PowerShell – Get serial numbers for computers in Active Directory

image_pdfimage_print

PowerShellThere are a lot of posts about pulling data from a file to do actions against computers/users. While this is valuable, I prefer to do dynamic capturing of computer and user objects directly from my Active Directory.

This is a simple script which will capture a list of computers from Active Directory and subsequently pull the serial number using the Get-WMIObject CmdLet using the Win32_BIOS class.

The neat addition over many other scripts I have used is the addition of the -ErrorAction SilentlyContinue option which prevents offline computers from sending error information in the output. Add some error handling and you now have a list of computers which are offline or inaccessible.

As with many of the scripts I will show you, you need to install ActiveRoles CmdLets from Quest Software (follow the link in the Gist)

Here’s the code: http://gist.github.com/492475

List of serial numbers from Active Directory computers

List of serial numbers from Active Directory computers

DiscoPosse

People, Process, and Technology. Powered by Community!

You might also like

LEAVE A COMMENT

Proudly Sponsored By

Advertisement

GC On-Demand

Subscribe to the Blog

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Upcoming events:

Archives