I am trying to collect all the server objects in a OU in AD with C#, but I am not successful.
I try to access the OU like this:
var context = new PrincipalContext(ContextType.Domain, "NO", "OU=Servers");
Is this correct?
And I try to group with this:
var groupPrincipal = new GroupPrincipal(context, "*");
But that throws an error.
What is the right way to go about to access the objects in a OU?