RDS provider + controller

This commit is contained in:
a.skorina 2014-11-10 11:14:15 +03:00
parent d01ec8ac44
commit 2e97811d33
21 changed files with 7552 additions and 117 deletions

View file

@ -130,6 +130,31 @@ namespace WebsitePanel.Providers.HostedSolution
return res;
}
public static bool IsComputerInGroup(string samAccountName, string group)
{
bool res = false;
DirectorySearcher deSearch = new DirectorySearcher
{
Filter =
("(&(objectClass=computer)(samaccountname=" + samAccountName + "))")
};
//get the group result
SearchResult results = deSearch.FindOne();
DirectoryEntry de = results.GetDirectoryEntry();
PropertyValueCollection props = de.Properties["memberOf"];
foreach (string str in props)
{
if (str.IndexOf(group) != -1)
{
res = true;
break;
}
}
return res;
}
public static string CreateOrganizationalUnit(string name, string parentPath)
{
string ret;