if Not GetWMIStuff("Win32_BIOS","SerialNumber",strSerialNumber) then
WScript.Echo "ERROR, Could not retrieve serial number"
WScript.Quit(1)
end if
' --- If we got this far then we have the site and serial number, if you want to see it
' --- uncomment the next line
WScript.Echo "The raw serial number is" & strSerialNumber
' --- Add leading Alpha characters to avoid DNS confusion
strSerialNumber= "site" & strSerialNumber
' --- Build Command Line, to check out the command line uncomment
strCommandLine = PATH_TO_WSNAME & " /N:" & strSerialNumber & " " & WSNAME_PARAMETERS
WScript.Echo "About to run the following command:" & vbCRLF & vbCRLF & strCommandLine
' --- Now call WSName with the serial number
Call WshShell.Run(strCommandLine,1,FALSE)
' --- Game Over!
' ---------------------- Helper Functions ----------------------
Function GetWMIStuff(strInstance,strProperty,strResult)
Dim colWMIStuff, objWMI, propWMI
GetWMIStuff=False
Set colWMIStuff= GetObject("winmgmts:").InstancesOf(strInstance)
For Each objWMI In colWMIStuff
For each propWMI in objWMI.Properties_
If (Not IsNull(propWMI.Value) AND Uelse(propWMI.Name) = Uelse(strProperty)) Then
strResult=propWMI.Value
GetWMIStuff=True
Exit Function
End If
Tried to add this into the mix,but no luck:
subnet subnett = subnet If subnett = "10.2.144" then site = "AMS" elseif subnett = "10.2.20" then site = "ATL" end if



Help
Back to top









