I have been asked to write a small utility to copy users from an AD to another system.
I found this posting which looks perfect to get me going...
How can I get a list of users from active directory?
As I don't have an AD to work with, I went to my Azure portal and created one on there to test against...
Then, it looked like all I needed to do was insert my domain in this line....
using (var context = new PrincipalContext(ContextType.Domain, "yourdomain.com"))
My domain, as supplied by Azure is xxxx.onmicrosoft.com
but when I run the code, I keep getting
An unhandled exception of type 'System.DirectoryServices.AccountManagement.PrincipalServerDownException' occurred in System.DirectoryServices.AccountManagement.dll
Additional information: The server could not be contacted.
Can anyone see what I am missing please?
i borrowed my mates old server and built a local server 2012 and joined the domain.
probably not everyone's answer. but worked for me.
(if i had more time i would have liked to get the azure domain working... im sure i built it right. just didn't work.
so that's my answer.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments