locked
Retrieve the number of physical and virutal machines in the domain RRS feed

  • Question

  • I am trying to inventory a messy environment. There is no VCM or ECM at all. So to figure things out you have to go to the device or write a script.

    I have chosen to write scripts. I have a script that allows me to get all machines in the domain. But I need to definitely know what is a physical and which

    is a virtual machine. Is there any straight and simple way to do this?

    MY thoughts:

    1. Write a script that will remotely run 'systeminfo' in the list remote.txt which contains names of remote server. If the system manufacturer is VMware or something else as opposed to HP or dell etc. This technical is a VIRTUAL machine. Else it is a physical machine.

    2. Write a script to get only the names and IP of windows server in the Vcenter then subtract this from the list of all servers from the Vcenter to validate the server counts.

    Please point me in the right direction if you can send a script I will appreciate it. When all is said and done I will push bunch of script for everyone that contributed. ciao!

    NOTE

    There is no auditing tools as I mentioned earlier.


    • Edited by SBSSERVER Thursday, April 4, 2013 3:38 PM chnage
    Thursday, April 4, 2013 3:36 PM

Answers

  • All you need to do is use Get-WMIObject win32_ComputerSystem -computername $computer 

    Can you post up a script that uses that command to try and do what you want?  I'll be happy to edit it for you if you make the initial effort to outline a script.  Like Bill was saying, no one here is getting paid to write your script.


    Hope that helps! Jason

    • Marked as answer by IamMred Wednesday, May 1, 2013 3:43 AM
    Thursday, April 4, 2013 6:22 PM

All replies

  • Hi,

    While we like to help with specific questions, nobody probably has the time to write your auditing solution for you (at least, not for free).

    So you will probably need to search for scripts that perform different parts of your solution and put the parts together to get what you need.

    Alternatively, you could influence your employer to use a proper auditing solution. There may even be some free ones out there (you searched before asking, right?).

    Bill

    • Proposed as answer by Bill_Stewart Monday, April 15, 2013 7:18 PM
    Thursday, April 4, 2013 4:45 PM
  • All you need to do is use Get-WMIObject win32_ComputerSystem -computername $computer 

    Can you post up a script that uses that command to try and do what you want?  I'll be happy to edit it for you if you make the initial effort to outline a script.  Like Bill was saying, no one here is getting paid to write your script.


    Hope that helps! Jason

    • Marked as answer by IamMred Wednesday, May 1, 2013 3:43 AM
    Thursday, April 4, 2013 6:22 PM
  • Also if you're using VSphere then PowerCLI will let you run get-vm which should give you the names of all of your virtual servers along with any other info you want.

    Hope that helps! Jason

    Thursday, April 4, 2013 6:23 PM
  • you can categorize the physical or virtual machine by their manufacturer or vendor or product

    for physical it might be Dell,lenova like that

    for virtual it may be vmware,virtualbox like that

    so you can categorize by that

    check this one This may help you

    http://gallery.technet.microsoft.com/Retrieve-the-number-of-344c63d5
    Friday, April 5, 2013 4:53 PM