This Active Directory article - adding a user to a group from a non-domain computer throws a PrincipalException , pointing me in the right direction. Although this really does not make sense. I switched to a more modern approach than higher than using PrincipalObjects, for example:
var _connection = new PrincipalContext(ContextType.Domain, _ldapserver, "DC=domain,DC=com", ContextOptions.SimpleBind, _adminUser, _adminPassword); var _userData = UserPrincipal.FindByIdentity(_connection, username);
this allowed me to pass the correct permissions to the domain controller, but then the group method on the UserPrinicpal object chose error 1155.
I solved this using the old method as follows. Now everything is working well.
DirectoryEntry de = (DirectoryEntry)_userData.GetUnderlyingObject(); object obGroups = de.Invoke("Groups");
Rob a
source share