Powershell – Function to Query Serial Number on a Dell

| | Comments (0) | TrackBacks (0)

Powershell

 

Hey wouldn’t you like a nice way to pull the Service tag from that Dell computer WITHOUT bothering the Vice President?

If you have at least good naming convention in your network it’s easy.  Here’s a function you can add to your Powershell Profile called “GET-SERVICETAG”.  It will query a computer via WMI and show the Service Tag.   Should work with about any Dell as long as WMI is enabled.

 

function global:get-servicetag ( $computername ) {

return $tag=get-wmiobject win32_bios -computername $computername | select-object SerialNumber

}

 

So with this added to your profile you can now execute a

GET-SERVICETAG NetBiosName

Where NetBiosName is the name of the computer in question and it will show the Service Tag.   I’ve enabled this function to return the tag as well so you CAN actually run this in a script against a series of computers too!

The Power of Shell is in YOU

Sean
The Energized Tech

0 TrackBacks

Listed below are links to blogs that reference this entry: Powershell – Function to Query Serial Number on a Dell.

TrackBack URL for this entry: http://www.energizedtech.com/cgi-sys/cgiwrap/jolyrogr/managed-mt/mt-tb.cgi/326

Leave a comment