Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. [C++] Remote WMI ==> "Access denied"

[C++] Remote WMI ==> "Access denied"

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++databasecomsecurity
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mocrotronics
    wrote on last edited by
    #1

    Hi all, I'm trying to remotely execute a WMI query using C++ code. I get connected succesfully, but when I execute the query I get a DCOM "access denied" error. When I create on this remote machine a username and password equal to the one i use locally, it all works fine. So this has to do with the security settings within the CoSetProxyBlanket and CoQueryProxyBlanket DCOM functions. I'm using the microsoft example on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/example__getting_wmi_data_from_a_remote_computer.asp[^] Who can help me out?:) Thanks in advance!

    S 1 Reply Last reply
    0
    • M mocrotronics

      Hi all, I'm trying to remotely execute a WMI query using C++ code. I get connected succesfully, but when I execute the query I get a DCOM "access denied" error. When I create on this remote machine a username and password equal to the one i use locally, it all works fine. So this has to do with the security settings within the CoSetProxyBlanket and CoQueryProxyBlanket DCOM functions. I'm using the microsoft example on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/example__getting_wmi_data_from_a_remote_computer.asp[^] Who can help me out?:) Thanks in advance!

      S Offline
      S Offline
      Sheng Jiang
      wrote on last edited by
      #2

      Topic in microsoft.public.windowsxp.security_admin WMI settings for remote access on XP From: Jerry Bryant [MS] - view profile Date: Fri, Jan 25 2002 4:09 pm 1. the user needs to either be an admin on the XP machine or have remote enabled privilege set on the XP machine 2. Win2k needs the SP because XP requires at least Packetlevel authentication and the SP fixes a bug in Win2k to correctly allow Packetlevel connections 3. if the XP machine is in a workgroup, you won't be able to remote in anyways as all incoming connections to the XP machine will be reduced to the guest account (this is by-design of the OS), if in a domain, it should work given the previous 2 statements are fulfilled. How to enable remote privileges on the XP machine: 1. Right Click "My Computer", choose "Manage" 2. Open "Services And Applications", right click over "WMI Control" and choose "properties" 3. Click on the "Security" Tab, highlight the namespace you want to give security to (most likely root\cimv2) and click the Security button 4. add the user, and check "Remote Enable" also check out this: http://support.microsoft.com/kb/q282949/ if you are using XP home in Step #3 behavior cannot be changed. If you are using XP Pro in a workgroup you can change the behavior via the local group policy: Computer\Windows Settings\Security Settings\Local Polices\Security Options: Network Access: Sharing and security model for local accounts: In unjoined WinXP Pro the ForceGuest behavior is on by default. This will cause all inbound connections to be anonymous (null) connections. Try disabling the ForceGuest behavior by setting the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\ForceGuest value to 0 and reboot. The "firewall" option on the LAN connection must be disabled. Regards Microsoft MVP in Visual C++ http://blog.joycode.com/jiangsheng

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups