WMI/Wbem permissions problem

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: kenman (kenman.11v3yk_at_mail.mcse.ms)
Date: 02/19/04


Date: Thu, 19 Feb 2004 00:28:32 -0600


Hello all,

Hello all, I'm working on a LAN script (actually I have about 5
different non-working versions) that will give me just a basic set of
info for now: PC name, IP address, subnet mask, OS version, CPU
speed... of all the PC's connected to the LAN at that time.

To complicate things, I do not have physical access (nor terminal
services access) to the Win2k server. I do have full control over the
inetpub folder, and I've disabled anonymous access (intranet-only
server). I can get changes made on the server but it involves approval,
red-tape, and time.

Anyways, I run this code and I get a permission denied error. I had the
server admin run it (remotely) and he got the same thing. Can anyone
help me out please?

<%'-------------------------------------
function getIPs
        strComputer = "."
        Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
        Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer,
"root\cimv2")
        objSWbemServices.Security_.ImpersonationLevel = 3
        Set IPset = objSWbemServices.ExecQuery("SELECT IPAddress,Description
FROM Win32_NetworkAdapterConfiguration where IPEnabled=true")
        For Each IP in IPset
                msg = msg & IP.IPAddress & "<BR>"
        Next
        getIPs = msg
end function

response.write getIPs
%>

kenman
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message407225.html