假设现在有一个用户zhangsan,位置在ladp://192.168.213.168/cn=zhangsan,cn=users,dc=pk1,dc=cctv,dc=com,现在想将这个用户添加到位于ladp://192.168.213.168/cn=pg_group,ou=org_pgm,dc=pk1,dc=cctv,dc=com的用户组中,
代码如下:
c#代码
string grouppath = "ladp://192.168.213.168/cn=zhangsan,cn=users,dc=pk1,dc=cctv,dc=com";
directoryentry group = new directoryentry(grouppath );
string userpath = "cn=zhangsan,cn=users,dc=pk1,dc=cctv,dc=com";
group.properties["member"].add(userpath );
group.commitchanges();