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