A
Andy_Alpha
Here's code,that i think,add user in group
....
DirectoryEntry grp=new DirectoryEntry(GroupName);
MessageBox.Show(GroupName,"group to add");
try
{
if (grp!=null)
{
grp.Invoke("Add",new object[] {User.Path.ToString()});}
grp.CommitChanges();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message,"An Exception occured during adding to group");
}
}
....
GroupName is something like
LDAP://cn=Admin,ou=Administration,ou=main office,dc=beta-comp,dc.com
It generate exception:
"Exception has been thrown by the target of an invocation"
Help me please!
P.S. Very sorry for my english![Smile :) :)](/styles/default/custom/smilies/smile.gif)
....
DirectoryEntry grp=new DirectoryEntry(GroupName);
MessageBox.Show(GroupName,"group to add");
try
{
if (grp!=null)
{
grp.Invoke("Add",new object[] {User.Path.ToString()});}
grp.CommitChanges();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message,"An Exception occured during adding to group");
}
}
....
GroupName is something like
LDAP://cn=Admin,ou=Administration,ou=main office,dc=beta-comp,dc.com
It generate exception:
"Exception has been thrown by the target of an invocation"
Help me please!
P.S. Very sorry for my english
![Smile :) :)](/styles/default/custom/smilies/smile.gif)