Question

I need to create new users in AD with a randomly generated password that must be reset on first login. I can connect without issue using DirectoryEntry but I would like to use System.DirectoryServices.AccountManagement. When attempting to connect to the server over SSL I get the following exception:

The ContextOptions passed are invalid for this store type. Either Negotiate or SimpleBind must be specified and they cannot be combined.

using ContextOptions.SecureSocketLayer.

Both Negotiate and SimpleBind throw exceptions when attempting to set the user password as I must be connected over SSL.

Since I can connect over SSL with DirectoryServices I don't think the code is the issue but will post anything that may be helpful.

Was it helpful?

Solution

Turns out it was a security issue, nothing wrong with code or site setup.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top