Quantcast
Channel: Azure Virtual Machines forum
Viewing all articles
Browse latest Browse all 12545

remote execution of powershell on azure IAaS VM using C# Code

$
0
0

hi

I have to run some powershell command in remote Azure VM, from my local machine. I can do it in interactive mode, using enter-possession.

But I want to achieve this from a C# code. I tried creating remote runspace as mentioned at -http://msdn.microsoft.com/en-us/library/ee706560(v=vs.85).aspx,using WSManConnectionInfo , but runspace.Open is failing. If I use

AuthenticationMechanism.Basic - it fails with message "The WinRM client cannot process the request. Unencrypted traffic is currently disabled in the client configuration"

For other enum it fails "The following error with errorcode 0x80090311 occurred while using Kerberos authentication: There are currently no logon servers available to service the logon request"

Any pointers, on how to execute Remote Powersehll call from C# code.

My Azure VM have 2 scenario. One VM is in workgroup and second VM is in Active Directory (created in Azure Virtual network).

Thanks


singhhome


Viewing all articles
Browse latest Browse all 12545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>