Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

ConnectionOptions without username and password

$
0
0

I get access denied error when I'm trying to connect to a remote cluster using the below code. I wanted to establish connection without supplying username/password in the code. I stored them in Windows Credential Manager. This works when I provide username and password in the code. How should I make it to read from the credentials manager?

ConnectionOptions Options = new ConnectionOptions(); //String Domain = "mydomain"; String Domain = ""; //Options.Username = "administrator"; //Options.Password = "mypassword";

Options.Authority = "ntlmdomain:" + Domain; Options.Authentication = AuthenticationLevel.PacketPrivacy;

ManagementScope Scope = new ManagementScope(@"\\win2012cluster\root\cimv2", Options); Scope.Connect();

Thanks

Viewing all articles
Browse latest Browse all 31927

Trending Articles



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