Code Monkey home page Code Monkey logo

Comments (4)

Jinjinov avatar Jinjinov commented on August 26, 2024

I have never hear that WMI would require permissions to use on the local machine.

According to this, you don't need any special permissions:
https://stackoverflow.com/questions/24295301/does-wmi-access-in-net-required-administrative-privileges

You only need permissions to use WMI on a remote computer, but my library doesn't do that.

Do you have an example where Hardware.Info would require any special permissions?

from hardware.info.

adhip94 avatar adhip94 commented on August 26, 2024

I have a customer who uses this on their machines. In this case our application which uses Hardware.Info to verify if ram, disk storage etc. is available at startup fails since application is not able to access underlying OS functionalities, which causes WMI to fail. Hence I requested for a method/check to verify if WMI is accessible or not.

from hardware.info.

Jinjinov avatar Jinjinov commented on August 26, 2024

I see. It would really help me if you would provide me with the steps to replicate this failure, so I would know what the problem is.

Just show me the minimal code necessary for this failure to happen.

from hardware.info.

Jinjinov avatar Jinjinov commented on August 26, 2024

I didn't find any mentions of WMI failing on a local machine due to lack of permissions.

If you don't show me how this failure happens - what exception is thrown - then I can't do anything to fix it.

If the problem is that the user needs administrator privileges, then you can check that yourself:
https://stackoverflow.com/questions/5953240/check-for-administrator-privileges-in-c-sharp

using System.Security.Principal;

bool isAdministrator;
using (WindowsIdentity identity = WindowsIdentity.GetCurrent())
{
    WindowsPrincipal principal = new WindowsPrincipal(identity);
    isAdministrator = principal.IsInRole(WindowsBuiltInRole.Administrator);
}

I will not add this to my library.

from hardware.info.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.