About us

IIS covers the IT solutions to the issues come across now and then in a company IT infrastructure including Operating system, Softwares, Scriptings, securities and reviews.

Thursday, 6 March 2014

PowerShell Script - Model, Name, Serial Number

One who is starting to learn powershell this ones for you fella. This is a very basic script to fetch Computer Model, its name and manufacturer serial number which is unique and helps to identify the machine from a lot.This one works from sitting on your own machine and is able to pull the information from multiple computers one by one. What we you have to do is to add every computer name in a text file then it will connect to all those machine one by one and will keep fetching the details for you in an well defined manner.

Change the filename given in bold letters and put computernames in it. Run the below script from powershell only.


$com = Get-Content C:\FileNAme.txt
foreach($computers in $com){
$sn =  Get-WmiObject -Class win32_bios -Computername $computers -EA silentlyContinue
$cn =  Get-WmiObject -Class Win32_ComputerSystem -Computername $computers -EA silentlyContinue
Write-Host $sn.SerialNumber, $cn.Name, $cn.Model

}

Regards, IIS

No comments:

Post a Comment