Link to home
Create AccountLog in
Avatar of Techrunner

asked on

Manufacturer based computers

I have a task to determine the number of computers in the network manufacturer based.We have about 1500 computers under windows domain. Mainly they are Dell or HP. I need to know there qty. Is it possible through a utility ?

Please help me.

Avatar of John Gobert
John Gobert
Flag of United States of America image

There are lots and lots of 3rd party apps out there that will do network inventory.  Are you looking to spend money or do this on the cheap?

If all of your machines are running Windows you can use WMI to query the info from each machine.

The following link is a site that shows a few common & useful WMI queries and how to use them in VBscript and PowerShell.

ivan's blog - Common WMI queries I have found useful
here's one of FREE network inventory scanners:
Have you ever used Spiceworks Labsy?

It's a LOT more than an inventory scanner... it's also a system that uses your internal information to generate ads and such.  Not everyone is comfortable with that...

It is an option... just saying...
Avatar of Meir Rivkin
Get-ADComputer -Filter *  | select Name | %{ Get-WmiObject -Class win32_bios -ComputerName $_.Name | select name,Manufacturer} | group Manufacturer | select count,name

Open in new window

the result wil be something like:

 Count Name                                                                
  ----- ----                                                                
4 Dell Inc.
12 HP Pavilion
7 Asus
Avatar of Techrunner


Thank you experts for the replies.

I tried to run the above powershell command but it gives the error
Get-ADComputer -Filter *  | select Name | %{ Get-WmiObject -Class win32_bios -ComputerName $_.Name | select name,Manufacturer} | group Manufacturer | select count,name

Any guess ?

what is the error?
Import-Module -Name ActiveDirectory

Get-ADComputer -filter * | % {  Get-WmiObject  win32_bios -cn $_.Name -EA SilentlyContinue | Select-Object __Server, Manufacturer }
Hi ,
This is the error I received.

Also, is there any free utility to graphical report of the domain computer manufacturers.

The term 'Get-ADComputer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:15
+ Get-ADComputer <<<<  -Filter *  | select Name | %{ Get-WmiObject -Class win32_bios -ComputerName $_.Name | select nam
e,Manufacturer} | group Manufacturer | select count,name
    + CategoryInfo          : ObjectNotFound: (Get-ADComputer:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
ad this at the top of the script:
Import-Module ActiveDirectory

Open in new window

After adding that error has been changed.

Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
At line:1 char:59

+ Get-ADComputer -Filter *  | select Name | %{ Get-WmiObject <<<<  -Class win32_bios -ComputerName $_.Name | select nam
e,Manufacturer} | group Manufacturer | select count,name
    + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject], COMException
    + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
Is there also any free utility to achieve this ?

Get-ADComputer -Filter *  | select Name | %{ Get-WmiObject -Class win32_bios -Namespace "root\CIMV2" -ComputerName $_.Name | select name,Manufacturer} | group Manufacturer | select count,name

Open in new window

No still the same error.

Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
At line:1 char:59

There are some tools but I can't vouch for them to be honest... there are a LOT of them out there...

I just downloaded Lansweeper and installed it... it has a 30 day trial by default and it'll let you inventory everything on your network and then you can run reports to get the data you're looking for.  It was incredibly easy...
The command doesn't seems to work.

Make sure you dont have any extra characters in the end of each line of code in the script you run in powershell.
Can it be through free 3rd party software ?

I mean is there any way to generate the reports using free 3rd part tool.

Hello Experts
Any further ideas ? Easiest way to vendor names for my active directory ( 1500) computers.

Ok, do you have a list of computer names?
Yes I can generate that. no issues.
Ok.... I'm actually in the process of crashing for the night... as soon as I get up I will work up a script for you that'll take a text file input that contains a list of your computer names and run the following command on each one:

wmic computersystem get name, manufacturer

If you run that command from an admin DOS command prompt it will return the manufacturer and computer name of your pc.  You'll just need to make sure your user account has permissions to query all of the PC's on your domain.  

Each time the loop runs it'll append the text results to an output file so that when it is done, you'll have a list of computer names and manufacturers.

Will that help you?
Thanks for that efforts and your precious time.
Just for clarification I have to run the command on each client machine by visiting them ?

Not as long as you have a list of the computer names or IP addresses.  The script I can write will just loop through and it'll run the command remotely on each one.  Even if it takes a little while to loop through the entire list you won't have to go visit every station... just start it and let it run in the background until it finishes.

I have to be up in about 6 hours so I'll post again once I'm back online...

Sorry I can't do it right now man but I've slept very little in the last three days... I'm burnt..
No problem Sir take your time.
I will wait for the script. I will be very thankful.

Sorry for the delay... I overslept like crazy today.

Ok... you said you can get a list of computer names... you'll want to just make it a text file with each computer name on a separate line enclosed in " " to prevent any issues with special characters.  Even if your computer names don't use special characters, do it anyways just to be safe.  Here's how the content of the file should look:


Save that file to a folder on your PC that you know the full path to.  In my testing I just created a new folder named C:\01share and saved the file there as computers.txt.

Once you have your computer list we can run the command.  First, does your username and password have admin access to ALL of the computers in your network?  If not, this process nor any other tool will work... you need to have an account available that has access to all of the machines.  If you'r account doesn't, but you can be provided with one that does we can specify the credentials in the command.  I'll write it out below both with a specified username and password and without.

I'm going to assume that you followed my example and created a folder on your PC named C:\01share.  The output from the command will be saved to that folder... if you didn't you can change the output file path below to match your preference.

Start an admin level command prompt session.

Run the following command if you don't need to specify a different username and password:

wmic /node:@"c:\01share\computers.txt" /output:"c:\01share\output.csv" computersystem get name, manufacturer /format:csv

If you DO have to specify a different username and password run the following:

wmic /node:@"c:\01share\computers.txt" /output:"c:\01share\output.csv" /user:DOMAIN\username /password:"PASSWORD" computersystem get name, manufacturer /format:csv

As the command runs it will loop through each computer name in the text file "c:\01share\computers.txt" and will use WMI to get the computer name and the manufacturer.  Each response will be written to the file "c:\01share\output.csv" in a comma delimited format.

IMPORTANT:  Any PC that is not online when you run this, or any PC that has a firewall up that blocks incoming WMI queries will fail.  The process will continue until it finishes the list and it will output an error for each machine that fails back to you.  Just record the failure list and then check to see if they're just shutdown, have firewalls up or if your user account doesn't have access to that machine.

Please feel free to reply with questions...
Firstly I would like to thanks for  the great inputs. I ran the command but got some quick questions.
-  For some computers, it says the RPC server is unavailable. I checked firewall and user accounts permissions,they are ok. I can ping those PC's Likely what could be the issue.

- The output  of CSV format cells is no correct, Can it be only 2 separate columns Computer Name and Manufacturer


Couple things to check for the RPC error.  The most common is that remote administration isn't enabled in the remote machine's firewall.  The following command run on those machines will resolve that:  netsh firewall set service remoteadmin enable

Are all of the computers you're running this against located in the same local office network or are some at off-site locations?  Any VPN's or firewalls between you and any other sites?

As far as the output... I'm not sure what you mean about the format not being correct.  Can you explain?

You can add as many additional data points as you want (that are supported)... I just put those two because you were looking for the manufacturer for each machine so to keep it simple I wrote the query for the computer name and manufacturer.  There's a LOT of information out on the internet about using WMI.  Here's a few sites you might want to review:

ComputerHope - Windows wmic command line command - WMIC
Sorry I for forgot to attached the snapshot.

Here is the snapUser generated image
FYI... you can run the netsh command remotely on those machines...

netsh -r COMPTUERNAME -u DOMAIN\UserName -p PASSWORD firewall set service remoteadmin enable

You'll need to replace the bold items with the correct values...

COMPUTERNAME is the name of the remote PC you're trying to update
DOMAIN\UserName should be a user account that has admin rights on that PC
PASSWORD is the password for the account you just used

Understand too that this assumes that remote administration has already been enabled on those PC's which is should be given you're working in a corporate network...
First, that's because you're opening it in Excel.  A CSV is a text file that uses commas to separate values into logical columns.  Excel can usually interpret a csv file and display it in a grid fashion like a normal Excel file not always.

In this case all you need to do is use the Text to Columns function in Excel to break it out.

I don't know what version of Excel you're using so I can't tell you exactly where to find the Text to Columns button... I'll base my quick instructions on Excel 2010.

With the file open like you have it in your screenshot, click to select column A (click on the A at the top of that column).

At the top of the Excel window (the command ribbon) click on the Data tab.

Click on Text to Columns (towards the middle right of the Data command ribbon).

When the "Convert Text to Columns Wizard" box opens make sure "Delimited" is selected and click Next.

Check the box for "Comma" and un-check any others.  Click next.

Click finish.

The data should now be spread out into separate columns.
Similarly, how I can achieve this on all computers using script

netsh -r COMPTUERNAME -u DOMAIN\UserName -p PASSWORD firewall set service remoteadmin enable

You're planning to spot me some awesome points, right??  :)

Ok... once again we'll use a text file with the list of computer names you need to run this command against.  We'll assume for now that the file is C:\01share\computers.txt just like earlier.

Open an admin level command prompt session and run the following command:

for /F "tokens=1,2* delims=," %i in (C:\01share\computers.txt) do netsh -r %i -u DOMAIN\UserName -p PASSWORD firewall set service remoteadmin enable

Remember to set the username and password to one that has admin access to the workstations you're trying to update.

This command, as written, will loop through the text file and run the netsh command on each one.
I am sorry for that Just a very last question..there is no way to obtain the computer manufacturer name using an ( free) application or program.

Thanks for your time.

Avatar of John Gobert
John Gobert
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thanks. Well I'll give a try.

Once you have it downloaded and are ready to run your scan you can enable the WMI query by clicking Options -> Remote WMI then selecting Windows Name & Computer Model from the available options.  Be sure to add in the username and password for the account you're using to run the query.

Here's two screenshots showing you what I'm talking about.

User generated image
Wow, Thanks a lot for that useful tool. Can I solve RPC server unavailable issue with this tool ?

No this is a scanning tool... to my knowledge it doesn't make changes, just gathers information.  If you're getting RPC errors with the WMIC command I gave you earlier then you'll get the same error using this tool.  The only difference is that this tool is also pinging each IP or computer name before trying to query it.  If the device isn't online or has a firewall preventing your traffic from reaching it then it will move on.

Like I posted earlier you will have to investigate and resolve the RPC errors.  None of the tools I'm aware of will be any different.  For this type of activity to work a few things have to be true:

Your user account must have permissions on the remote machine
Remote administration must be enabled on the remote machine
The remote machine's firewall must allow remote administration
Any firewall device between you and the remote machine must allow RPC traffic to pass

If any one of these aren't met then nothing you do will accomplish your goal.
Sorry for the delay in reply. That utility worked like a charm I was not able to get information for all the pc's since they were not reachable due to reasons as you mentioned.
I would like to thank you for your help support and efforts.