Tags


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

Advertisements