RDS provider + controller
This commit is contained in:
parent
d01ec8ac44
commit
2e97811d33
21 changed files with 7552 additions and 117 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue