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#
  4. WMI query doesnot return record for user having less previleges!!

WMI query doesnot return record for user having less previleges!!

Scheduled Pinned Locked Moved C#
helpcssdatabasetoolsquestion
1 Posts 1 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.
  • C Offline
    C Offline
    Cracked Down
    wrote on last edited by
    #1

    Hi all, I am trying to retrieve the Disk partitions using the following code lines

    foreach (ManagementObject mgmObj in gmtObjo.GetRelated("Win32_DiskPartition"))
    {
    //get the logical partitions and add to collection

    }

    This code snippet works well for user having administrative privileges on the machine.However,user having less privileges it does not retrieve any record. I have searched through net and got the solution where we have to give the permission to the WMI itself using WMITool.However,this solution seems like not feasible as I can not give the permission to client machine. I am looking for solution using which I would able to fetch the records irrespective of what user privileges are.Either through script or setting the privileges through code(setting through code might again require admin rights...). Anybody here had faced this problem before or have solution to this?? Help will be appreciated!!! Thanks in advance

    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