Hi,
I am trying to add a domain user to machines local remote desktop users group in the following way, but failed to get the expected result.
Thanks for the support in this regard.
Friendly,
Kamesh.
Thanks, Sri
I am trying to add a domain user to machines local remote desktop users group in the following way, but failed to get the expected result.
DirectoryEntry AD = newDirectoryEntry("WinNT://" + Environment.MachineName + ",computer", "resources", "asdf1234");
DirectoryEntry banvsgAD = newDirectoryEntry("LDAP://CN=Users,DC=easydom,DC=com", "domadmin", "dom123#");
DirectoryEntry domainUser = banvsgAD.Children.Find("domuser");
DirectoryEntry newUser = AD.Children.Add(@"easydom\domuser", "user");
newUser.CommitChanges();
DirectoryEntry grp;
grp = AD.Children.Find("Remote Desktop Users", "group");
if (grp != null) { grp.Invoke("Add", new object[] { newUser.Path.ToString() }); }
I am pretty to new to use the DirectoryServices concepts. Could somebody help me pointing to informative resources in this regard.Thanks for the support in this regard.
Friendly,
Kamesh.
Thanks, Sri