Adding and removing users from Active Directory groups in .NET

前端 未结 4 755
野趣味
野趣味 2020-11-29 00:14

I am writing the following methods to add and remove users from active directory in C#.

void AddUserToGroup(string userId, string groupName);
void RemoveUser         


        
4条回答
  •  情深已故
    2020-11-29 00:49

    The server is part of the groupDn variable value. For example:

    LDAP://myServer/CN=MyGroup,CN=Groups,CN=MyContainer,DN=mydomain.com

    The whole thing is the LDAP path for the group. The first part (myServer) is the server name.

    The part after the server name (e.g. CN=...) is the DN (distinguished name) of the group.

提交回复
热议问题