Solved

Manufacturer based computers

Posted on 2013-05-20
41
337 Views
Last Modified: 2016-11-23
Hello,
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.

Thanks
0
Comment
Question by:cciedreamer
  • 19
  • 14
  • 4
  • +2
41 Comments
 
LVL 8

Expert Comment

by:jpgobert
ID: 39180565
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
0
 
LVL 18

Expert Comment

by:Andrej Pirman
ID: 39180567
Hi,
here's one of FREE network inventory scanners: http://www.spiceworks.com/free-pc-network-inventory-software/
0
 
LVL 8

Expert Comment

by:jpgobert
ID: 39180576
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...
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 39180598
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
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39180613
Hi,
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 ?

Thanks
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 39180643
what is the error?
0
 
LVL 18

Expert Comment

by:Raheman M. Abdul
ID: 39180649
Import-Module -Name ActiveDirectory

Get-ADComputer -filter * | % {  Get-WmiObject  win32_bios -cn $_.Name -EA SilentlyContinue | Select-Object __Server, Manufacturer }
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39180653
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
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 39180662
ad this at the top of the script:
Import-Module ActiveDirectory

Open in new window

0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39180665
Hi,
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
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39180669
Is there also any free utility to achieve this ?

Thanks
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 39180670
try:
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

0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39180675
No still the same error.

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

Thanks
0
 
LVL 8

Expert Comment

by:jpgobert
ID: 39180676
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...

www.lansweeper.com
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39180689
The command doesn't seems to work.

Samir
0
 
LVL 18

Expert Comment

by:Raheman M. Abdul
ID: 39180878
Make sure you dont have any extra characters in the end of each line of code in the script you run in powershell.
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39180906
Can it be through free 3rd party software ?

Samir
0
 
LVL 18

Expert Comment

by:Raheman M. Abdul
ID: 39180931
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39180939
I mean is there any way to generate the reports using free 3rd part tool.

Thank
0
 
LVL 3

Author Comment

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

Thanks
0
 
LVL 8

Expert Comment

by:jpgobert
ID: 39183630
Ok, do you have a list of computer names?
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39183632
Yes I can generate that. no issues.
0
 
LVL 8

Expert Comment

by:jpgobert
ID: 39183642
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?
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39183650
Thanks for that efforts and your precious time.
Just for clarification I have to run the command on each client machine by visiting them ?


Samir
0
 
LVL 8

Expert Comment

by:jpgobert
ID: 39183655
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..
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39183667
No problem Sir take your time.
I will wait for the script. I will be very thankful.

Samir
0
 
LVL 8

Expert Comment

by:jpgobert
ID: 39186156
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:

"PCName01"
"PCName02"
"PCName03"

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...
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39186474
Hi,
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

Thanks

Samir
0
 
LVL 8

Expert Comment

by:jpgobert
ID: 39186494
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

SS64.com - WMIC
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39186504
Sorry I for forgot to attached the snapshot.

Here is the snapexcel
Thanks
0
 
LVL 8

Expert Comment

by:jpgobert
ID: 39186511
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...
0
 
LVL 8

Expert Comment

by:jpgobert
ID: 39186517
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.
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39186548
Hi,
Similarly, how I can achieve this on all computers using script

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

Thanks
0
 
LVL 8

Expert Comment

by:jpgobert
ID: 39186561
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.
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39186567
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.

Samir
0
 
LVL 8

Accepted Solution

by:
jpgobert earned 500 total points
ID: 39186594
There are a TON of tools all over the internet... some free, lots paid.  One option that I know of that's free that'll do this is Softperfect's Network Scanner.

http://www.softperfect.com/products/networkscanner/

You can basically have it scan your network and run WMI queries on machines it finds.  It also allows you to import a list of computer names or IP's instead of scanning IP ranges.  It's free and it actually works...
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39186601
Thanks. Well I'll give a try.

Thanks
0
 
LVL 8

Expert Comment

by:jpgobert
ID: 39186642
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.

Enable WMI Query
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39186740
Wow, Thanks a lot for that useful tool. Can I solve RPC server unavailable issue with this tool ?

Thanks
0
 
LVL 8

Expert Comment

by:jpgobert
ID: 39186756
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.
0
 
LVL 3

Author Comment

by:cciedreamer
ID: 39196849
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.

Thanks.
0

Join & Write a Comment

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now