Getting SWbemObjectEx: Not supported Error, when running WMI Scri

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to set BSSID on one of my wireless network adapters using WMI.
Let me first declare that the script was working perfectly on XP SP1.
On XP SP2, it shows the above error for the Put_ in the script below marked
by <<<<:

set objSWbemServices = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\wmi")
set colInstances = objSwbemServices.ExecQuery ("SELECT * FROM
MSNdis_80211_BaseServiceSetIdentifier WHERE Active = True AND InstanceName
='" & wifiAdapter & "'")


For Each objInstance In colInstances
WScript.Echo "Setting bssid for the NIC ... " & objInstance.InstanceName
WScript.Echo "MAC Before " & objInstance.Ndis80211MacAddress(5)
objInstance.Ndis80211MacAddress(0) = &H00
objInstance.Ndis80211MacAddress(1) = &H11
objInstance.Ndis80211MacAddress(2) = &H22
objInstance.Ndis80211MacAddress(3) = &H33
objInstance.Ndis80211MacAddress(4) = &H08
objInstance.Ndis80211MacAddress(5) = &He0
objInstance.Put_ <<<<<<<<<<<<<<<<<<<<<<<<<<<
WScript.Echo "MAC After " & objInstance.Ndis80211MacAddress(5)

Next



Could anybody please let me know what is the problem here?

Thanks in Anticipation,
 
Back
Top