Powershell Get Serial Number Remote Computer

Powershell Get Serial Number Remote Computer Average ratng: 4,0/5 6270 votes
  • The MemoryDevices column indicates how many memory slots are available on your computer while MaxCapacity tells you how much total of RAM you can install. To get the info from a remote computer, use -computername switch to the cmdlet. For example, Get-WmiObject -class 'Win32PhysicalMemoryArray' -computername C-20141222B.
  • This script will attach to a specified computer over the network and grab some information about it, including the serial number of the system and monitors attached to it. Kudos to Michael Baird and Denny Mansart for all that EDID code. The big deal is the monitor serial numbers, because that is a tricky piece of information to get.
  • You also can use WMIC for a remote computer. Here it is: wmic /node:%computername% bios get serialnumber. This helps when i am at a remote site and quickly need to get the service tag number on a remote computer of it got ripped off the computer I am working at.

Wmic Powershell Script to Get Computer Information Using 'wmic' Command (Serial Number, Manufacturer, Model, Network Printers): # Using wmic command to get information about computer and write to file# To use: Right click on File name > Left click on 'Run in Powershell' # Or hit F5 from within Powershell ISE editor# Create a file on the C driveout-file c: temp computerinf. Get serial number/TAG from remote pc with use of wmic Posted on July 6, 2010 by CloudWarrior Here is simple command line that works on Windows XP/VISTA/Windows 7, if you are in need to get the serial number aka TAG from remote computer on your network. Thanks guys, Much appreciated for the prompt response. Unfortunately I hadn’t written much so far as powershell is virtually brand new to me, I had played around with vbscript many years ago and read several forums warning of especially Dell using different Serial numbers than what is on the sticker and apparently the need to search for “Friendly Names/Numbers”.

There 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.

Wwf no mercy rom hack. 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

In your first six months on the job, you’ll lose a lot of time researching how to do basic tasks. I want to make your life a little easier by giving you scripts that make these tasks faster.

This is probably going to be the least sexy blog post ever written, but being able to access serial numbers for computers on your network is fairly important, so here I go!

Let’s address your unspoken question first: why should you care about serial numbers?

Serial numbers are assigned by the maker of your computer and are useful for asset management, mainly. The two main use cases, specifically, are for asset tracking and for warranty information. This post is getting unsexier by the minute, so let’s just jump right in with a real-world example.

Let’s say that you have a user, John Smith, who’s been with the company for four years. During that time, he’s had the same laptop. Today, he comes to you with an issue: his laptop is not able to connect to the network when he hard-wires in (which is another way of saying he plugs in an ethernet cable to connect.) After spending some time diagnosing the issue, you eliminate all possible software and firmware causes. The cause is definitely a physical problem with the NIC (Network Interface Card) which will need to be replaced. Unfortunately, since this is a laptop and the NIC is soldered on, that means you’ll need to replace the whole motherboard.

At this point, you might be asking yourself two questions: is this laptop under warranty, and what level of support can I get for it? The laptop is labeled “JSMITH”, but the maker of the laptop (let’s say Dell in this case) is not going to identify the laptop the same way – you can’t call them up and tell them it’s John’s laptop and expect them to know which laptop you’re talking about.

Enter the serial number.

Each laptop has its own serial number. (If you want to be specific, the motherboard is the part of the laptop that is assigned a serial number.) Armed with the serial number, you can go to Dell’s site and pull warranty information. Put in your serial number and you’ll find out when your warranty expires and what level of support you can expect. For example, you may see that you have next-day pro support. If that’s the case, rejoice! You’ll have a tech from Dell show up the next business day to replace your motherboard!

Powershell Get Serial Number Remote Computers

So, how do you find out a computer’s serial?

If you’re physically in front of the computer, you can restart it and load the BIOS. (This is a different process depending on the computer make and model, but it usually involves pressing delete, F11, or another key at the right time.) This is both time-consuming and annoying to the user. They’ll inevitably have to spend five minutes saving their work and closing out of their applications so you can restart. It’s also a very manual process which doesn’t scale well when you have to do the same thing for 100 computers.

Another way to do this is to open a PowerShell prompt (by pressing start, typing “PowerShell”, and pressing enter) and typing: Mobile crane manual free download.

Get-WmiObject -Class win32_bios

That’s a lot quicker than the first method! But… it’s still manual, and you may not always be able to get physical access to a computer when you want it.

Let’s now take a look at a very simple PowerShell script that can get you the serial number of a computer somewhere on your network:

Powershell Get Model And Serial Number Remote Computer

$CompName = read-host -prompt “Please enter the machine name “

get-wmiobject -computername $CompName -class win32_bios

To use this, launch “PowerShell ISE” (as opposed to “PowerShell.”) I personally recommend you always use ISE for your PowerShell needs. ISE is essentially PowerShell but with a space for you to write out as many commands as you want. This is not so important when you want to write a quick one-liner, but when your script requires twenty lines, you don’t want to be writing them out each time! ISE allows you to save your scripts and reuse them.

Let’s start by doing that. Open PowerShell ISE, paste the above two lines into the white space, and press the save button. Now, you can run this script whenever you need it from the comfort of your desk.

At this point, let me mention my usual PowerShell warning: get in the habit of never running a script from the Internet without understanding what it does. PowerShell can be very unforgiving, and you can wreck your environment pretty easily!

So what does this script do? Let’s read it out in plain English. (The below is called pseudo code, fyi.)

“Ask for the name of the computer.

Find that computer and run the command to get the serial number on it.”

Powershell Get Serial Number Remote Computer Programmer

Read-host is PowerShell’s way to read input right from the command line. (PowerShell calls this the “host.”) The prompt is the question the host will ask. You can write whatever you want here.

The get-wmiobject command (technically called a commandlet, so let’s start using that term) is out of scope for this post. Entire books have been written on the subject, so for now let’s just accept that using WMI and specifying “win_32bios” will get you the serial information you’re looking for.

PowerShell commandlets can have parameters passed to them to make them more useful. In this case, we’re telling it that we’re going to pass a computer name to it. We pass the $CompName variable as the parameter, which is the computer name we collected in the first line.

That’s it! Now that you’ve saved this script, you can open it at any time, press “F5”, and PowerShell will prompt you for the computer name. This will work as long as the computer is connected to the same network as you.

I highly recommend you dedicate time to becoming familiar with PowerShell early on in your career. I recommend reading this book and once you’ve done that and have solid fundamentals, I really enjoy the Scripting Guy blog.

By the way, I should mention that there are a lot of enterprise grade tools that will track serial numbers for you, so find out if you’re using any of them in your workplace, but this is a nifty and quick way of getting the info that you need. As you grow your knowledge of PowerShell, you’ll be able to create more and more complex scripts that can rival any store-bought tool!

Powershell Get Remote Computer Serial Number

With each post, I cover a new topic to help you get your start (or keep progressing) in your IT career. If it’s your first time visiting this blog, start here. Or, see all my posts about interview questions you should be able to answer.