M
multisync
I have the following script:
<%
strComputer = "CPU210"
Set objWMIService = GetObject("winmgmts://" & strComputer &
"/root/cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS",,48)
For Each objItem in colItems
serialno = objItem.SerialNumber
Next
%>
<%=serialno%>
If i'm logged onto the computer "CPU210" it will display the serial
number. If I change the strComputer variable to "CPU215" and try to run
this page on CPU210 i get an error. But if i run the page on CPU215
with strComputer = CPU215 it works.
If i put this into a VBScript it works fine, no matter what computer i
run it on and no matter what the strComputer variable is.
So my question is, how do I fix this. All i'm trying to do is get the
LOCAL serial number from a computer in AD. I am not trying to get the
serial number from AD. I want to get the serial number from the actual
machine.
<%
strComputer = "CPU210"
Set objWMIService = GetObject("winmgmts://" & strComputer &
"/root/cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS",,48)
For Each objItem in colItems
serialno = objItem.SerialNumber
Next
%>
<%=serialno%>
If i'm logged onto the computer "CPU210" it will display the serial
number. If I change the strComputer variable to "CPU215" and try to run
this page on CPU210 i get an error. But if i run the page on CPU215
with strComputer = CPU215 it works.
If i put this into a VBScript it works fine, no matter what computer i
run it on and no matter what the strComputer variable is.
So my question is, how do I fix this. All i'm trying to do is get the
LOCAL serial number from a computer in AD. I am not trying to get the
serial number from AD. I want to get the serial number from the actual
machine.