I use vbscript/WMI to remotely query server info including BIOS. My
server BIOS info reads like "VMware Virtual Platform 6.00". I put it
into a for loop to query groups of computers. You can probably rewrite
it for your purposes.
 
>type model.vbs
On Error Resume Next
set oArgs = wscript.Arguments
strComputer = oArgs(0)
if strComputer = "" then
    strComputer = "."
end if
 
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
 
Set colItems = objWMIService.ExecQuery("Select * from
Win32_ComputerSystem",,48)
For Each objItem in colItems
    StrDomain = objItem.Domain
    StrModel = objItem.Model
    strName = objItem.Name
    StrProcs = objItem.NumberOfProcessors
Next
 
Set colEnclosureItems = objWMIService.ExecQuery("Select * from
Win32_SystemEnclosure",,48)
For Each objItem in colEnclosureItems
    StrSerNo = objItem.SerialNumber
    StrAsset = objItem.SMBIOSAssetTag
    If StrSerNo = " " Then StrSerNo = VbTab
    If StrSerNo = ""  Then StrSerNo = "    "
    If StrAsset = ""  Then StrAsset = "    "
    If StrAsset = " " Then StrAsset = "    "
Next
 
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS",,48)
For Each objItem in colItems
    strBios2 = objItem.SMBIOSBIOSVersion
    strBios3 = objItem.Version
Next
 
strComputer = strComputer + "            "
strComputer = Left(strComputer,16)
 
Wscript.Echo strComputer & StrSerNo & VbTab & StrAsset & VbTab &
StrProcs & VbTab & StrModel & VbTab & strBios2 & VbTab & strBios3 &
VbTab & strBios1
>cscript model.vbs //nologo electra
electra         None    No Asset Tag    2       VMware Virtual Platform
6.00    PTLTD  - 6040000

 



Doug Hilderbrand | Systems Analyst, Engineering Applications | Crane
Aerospace & Electronics


 


________________________________

        From: Sam Cayze [mailto:[email protected]] 
        Sent: Monday, August 24, 2009 9:02 AM
        To: NT System Admin Issues
        Subject: RE: Detecting virtual machines
        
        
        Or installed...

________________________________

        From: James Rankin [mailto:[email protected]] 
        Sent: Monday, August 24, 2009 10:46 AM
        To: NT System Admin Issues
        Subject: Re: Detecting virtual machines
        
        
        That's a good idea...I was leaning towards the same sort of
thing by checking for the VMWare Tools service, but I wasn't sure that
it would be started when the startup script executed
        
        
        2009/8/24 Kim Longenbaugh <[email protected]>
        

                If you use WMI in your script to show the nic type, you
could sort for the nic types that show up for virtual machines.  The
names will reference VMWare in some fashion, as in "VMware Accelerated
AMD PCNet Adapter"

                 

                 

                
________________________________


                From: James Rankin [mailto:[email protected]] 
                Sent: Monday, August 24, 2009 10:37 AM
                To: NT System Admin Issues
                Subject: Detecting virtual machines

                 

                Does anyone know of a good way to detect whether a
server is virtual or physical through a script of some kind? I am
currently filtering some of my GPOs via security group membership and I
have one group for physical servers, another for virtual. I am wondering
if there is some way I can run a startup script that will, when a
machine is first joined to the domain, identify whether it is a virtual
machine or not, and add it to the correct security group accordingly.
This would save me the headache of trawling through new-build machines
and adding them to the right groups. I am using VMWare ESX 3.5 for my
virtual machines. All suggestions gratefully received...
                
                
                TIA,
                
                
                
                JRR
                
                -- 
                "On two occasions...I have been asked, 'Pray, Mr
Babbage, if you put into the machine wrong figures, will the right
answers come out?' I am not able rightly to apprehend the kind of
confusion of ideas that could provoke such a question."
                
                http://raythestray.blogspot.com

                 

                 

                 

                

                 




        -- 
        "On two occasions...I have been asked, 'Pray, Mr Babbage, if you
put into the machine wrong figures, will the right answers come out?' I
am not able rightly to apprehend the kind of confusion of ideas that
could provoke such a question."
        
        http://raythestray.blogspot.com
        

         

        
         

        

         

        
         

        


--------------------------------------------------------------------------------
We value your opinion!  How may we serve you better? 
Please click the survey link to tell us how we are doing:
http://www.craneae.com/ContactUs/VoiceofCustomer.aspx
Your feedback is of the utmost importance to us. Thank you for your time.
--------------------------------------------------------------------------------
Crane Aerospace & Electronics Confidentiality Statement:
The information contained in this email message may be privileged and is 
confidential information intended only for the use of the recipient, or any 
employee or agent responsible to deliver it to the intended recipient. Any 
unauthorized use, distribution or copying of this information is strictly 
prohibited 
and may be unlawful. If you have received this communication in error, please 
notify 
the sender immediately and destroy the original message and all attachments 
from 
your electronic files.
--------------------------------------------------------------------------------

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

Reply via email to