Collect Service Tags/Serial Numbers using PowerCLI

10:46:00 PM , 0 Comments

Here is a useful PowerCLI script to collect Service Tags and Serial Numbers of the servers/blades. If you are maintaining an Inventory or gathering some information about the current hardware in your Datacenter this might be very useful to gather these information.

Run this script in your vCenter server and you will get the similar output as below. I have highlighted the serial numbers of the blades and servers in RED. In UCS you have the Chassis serial number and the blade serial number (right side) in the output. 

Create a script after copying the below code and save as a .ps1 file. Execute the script and you get the service tags of your servers. You may need to add your vCenter server IP or FQDN, username and password to this script. Also if you wish to export this to a .csv file add the Exprt-csv pipeline to export to a csv file.
Download the script.

Aruna Lakmal

Aruna Lakmal is a Senior Virtualization Engineer at Pearson and a simple person, VMWare Technology Junky, Enthusiast and a VMware vExpert. Simply believe in "Karma" Find me on LinkedIn !