cgooden01
asked on
Is there a way to script out gathering the BIOS GUID
Trying to see if there is a way to script out gathering BIOS GUID from a work station?
If you can find the value it would be via a WMI connection to the win32_Bios class
Might this do what you need?
http://home.wanadoo.nl/scripting/topics/f12/ultimatebb.cgi-ubb=print_topic;f=12;t=000206.htm
~bp
http://home.wanadoo.nl/scripting/topics/f12/ultimatebb.cgi-ubb=print_topic;f=12;t=000206.htm
~bp
Does MS store a GUID for the BIOS? Not sure, but there is also the Universal UID and you can get that by running this
wmic CSProduct Get UUID /format:list
The attached vbscript can poll for the system GUID of the system it's run on.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_ComputerSystemProduct",,48)
For Each objItem in colItems
Wscript.Echo "-----------------------------------"
Wscript.Echo "Win32_ComputerSystemProduct instance"
Wscript.Echo "-----------------------------------"
Wscript.Echo "UUID: " & objItem.UUID
Next
Sorry, mis-typed. That script pulls the UUID from the motherboard, useful if you're using RIS services. I suspect that's what you're after.
ASKER
Yes this is what i was needing, the UUID is about the same as the GUID. I was once upon a time very familiar with modifying VB, but apparently not now unfortunately. Therefore, i would like this piped out to text file with results and is there a way i can pull all of the machines on my Domain from a specific OU.
I'll need to work on the script some for text output (it's not really tough but $employer expects something productive today), but as far as running it on only a select OU, set it to run as a startup script.
Try this. It writes the UUID to the same directory from which the script is run with the name of the computer it's run on.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_ComputerSystem",,48)
' Open file for Writing
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
For Each objItem in colItems
Set MyFile = fso.CreateTextFile(".\" & objItem.Name & "_UUID.txt", True)
Next
' get and write UUID to file
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_ComputerSystemProduct",,48)
For Each objItem in colItems
MyFile.WriteLine "UUID: " & objItem.UUID
Next
' close the config file
MyFile.Close
ASKER
Works great, now let me ask you this, to finish up this question and task. Is there a way that this script can pull UUID from LDAP from all systems in Active Directory.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.