none
Cannot connect to WMI from Windows XP Pro SP2 to Windows XP Embedded SP3 RRS feed

  • Question

  • Hi,

    I am trying to run a remote WMI query from a PC, that is in a workgroup, Windows XP SP2 on a Windows XP Embedded SP3 PC, which is also in a workgroup.

    Firstly i created a user on the Embedded PC that is in the local administrators group. I granted the user to ability to run remote commands in COM+ and started MSDTC. There is no firewall between the 2 PC's. 

    When i run the query below

     

    strComputer = "10.15.131.83"
    strDomain = ""
    Wscript.StdOut.Write "Please enter your user name:"
    strUser = Wscript.StdIn.ReadLine
    Set objPassword = CreateObject("ScriptPW.Password")
    Wscript.StdOut.Write "Please enter your password:"
    strPassword = objPassword.GetPassword()
    Wscript.Echo

    Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
    Set objWMIService = objSWbemLocator.ConnectServer(strComputer, _
        "root\CIMV2", _
        strUser, _
        strPassword, _
        "MS_409", _
        "ntlmdomain:" + strDomain)
    Set colItems = objWMIService.ExecQuery( _
        "SELECT * FROM Win32_ComputerSystem",,48)
    For Each objItem in colItems
        Wscript.Echo "-----------------------------------"
        Wscript.Echo "Win32_ComputerSystem instance"
        Wscript.Echo "-----------------------------------"
        Wscript.Echo "Name: " & objItem.Name
    Next

    I am faced with error "SWbemLocator: Access is denied"

    If i try to connect remotely using wbemtest to \\10.15.131.83\root\cimv2 using the same local account i get

    Number: 0x80070005
    Facility: Win32
    Description: Access is denied.

    When i check the security logs on the Embedded machine it says that the user is unknown.

    The query will execute locally without issue.

    Please help !

     


    Craig
    Tuesday, May 31, 2011 4:08 PM