none
wmi remote connection with errors access is denied RRS feed

  • Question

  • hi,

    i use wmi to remote connect a computer, code as below:

     ConnectionOptions option = new ConnectionOptions();

    option.Username = myusername;

    option.Password = mypassword;

    then the quesion is, if i use the domain\xxx for Username, the connection is good.

    but if i use the local administrator(the remote machine's local administrator) for the username, then the error occurs: access is denied.

    can somebody tell me why?

    and i also tried on some other machines, some of them is good for both username, some not.

    Wednesday, December 6, 2017 7:07 AM

All replies

  • hi,

    i use wmi to remote connect a computer, code as below:

     ConnectionOptions option = new ConnectionOptions();

    option.Username = myusername;

    option.Password = mypassword;

    then the quesion is, if i use the domain\xxx for Username, the connection is good.

    but if i use the local administrator(the remote machine's local administrator) for the username, then the error occurs: access is denied.

    can somebody tell me why?

    and i also tried on some other machines, some of them is good for both username, some not.

    You have no administrator rights on those computers

    Success
    Cor

    Wednesday, December 6, 2017 10:09 AM
  • Do you get the access denied at connection or when you attempt to do certain operations (like a reboot)? Are you using the full user name on the remote machine (I.e. \\machine\user) or just the user name?

    Have you tried using WMI code creator to do the same thing? It can autogenerate the code you need.


    Michael Taylor http://www.michaeltaylorp3.net

    Wednesday, December 6, 2017 2:31 PM
    Moderator