none
C# WMI Remote Connect with Local User Account RRS feed

  • Question

  • Hello,

    I'm trying to connect to a machine remotely using WMI where the machine is in a domain using a local account.  Just to repeat the machine is in a domain but I want to use a local account to connect.  I cannot find the right set of ConnectionOptions to make this work.  I've tried using Authority set to "NTLMDOMAIN:<MACHINENAME>" but I get access denied.  I've also tried setting Authority to null and setting Username to <MACHINENAME>\<USERNAME> and I get access denied.  What is interesting is the security logs says the account is logging in fine but I'm getting access denied.  I'm using ImpersonationLevel.Impersonate and AuthenticationLevel.PacketPrivacy.  Any suggestions?

    Thursday, February 1, 2018 9:58 PM

All replies

  • Hi Geoff Craig,

    Thank you for posting here.

    For your question, You could download the source code from the link below. The code works well on my side. Please note that the application need to run as admin.

    https://www.codeguru.com/vb/gen/creating-a-remote-desktop-application-in-vb.net.html

    Best Regards,

    Wendy

    Note: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you. 
    Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet. 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 2, 2018 10:48 PM
    Moderator
  • Hello Wendy,

    That link doesn't apply, I'm trying to use WMI not RDP.  From all of my testing there is no way to do a remote WMI call using a local user account if the workstation is in a domain.  I tried the same thing in PowerShell and received access denied as well.  If there is anyone out there that knows how to get the correct ConnectionOptions settings I would be great appreciative.

    Thank you,

    -Geoff

    Saturday, February 3, 2018 5:52 PM
  • Hi Geoff Crsig,

    I search online, do not find the example about WMI remote computer.

    I hope the following link would be helpful.

    https://msdn.microsoft.com/en-us/library/aa389290(v=vs.85).aspx

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 7, 2018 5:21 AM
    Moderator