Merge
This commit is contained in:
commit
53f45cc1b9
2 changed files with 31 additions and 0 deletions
|
@ -91,6 +91,20 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
return rets.ToArray();
|
return rets.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static DirectoryEntry GetGroupPolicyContainer(string displayName)
|
||||||
|
{
|
||||||
|
DirectorySearcher deSearch = new DirectorySearcher
|
||||||
|
{
|
||||||
|
Filter =
|
||||||
|
("(&(objectClass=groupPolicyContainer)(displayName=" + displayName + "))")
|
||||||
|
};
|
||||||
|
|
||||||
|
SearchResult results = deSearch.FindOne();
|
||||||
|
DirectoryEntry de = results.GetDirectoryEntry();
|
||||||
|
|
||||||
|
return de;
|
||||||
|
}
|
||||||
|
|
||||||
public static bool IsUserInGroup(string samAccountName, string group)
|
public static bool IsUserInGroup(string samAccountName, string group)
|
||||||
{
|
{
|
||||||
bool res = false;
|
bool res = false;
|
||||||
|
|
|
@ -53,6 +53,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
private const string GROUP_POLICY_MAPPED_DRIVES_FILE_PATH_TEMPLATE = @"\\{0}\SYSVOL\{0}\Policies\{1}\User\Preferences\Drives";
|
private const string GROUP_POLICY_MAPPED_DRIVES_FILE_PATH_TEMPLATE = @"\\{0}\SYSVOL\{0}\Policies\{1}\User\Preferences\Drives";
|
||||||
private const string DRIVES_CLSID = "{8FDDCC1A-0C3C-43cd-A6B4-71A6DF20DA8C}";
|
private const string DRIVES_CLSID = "{8FDDCC1A-0C3C-43cd-A6B4-71A6DF20DA8C}";
|
||||||
private const string DRIVE_CLSID = "{935D1B74-9CB8-4e3c-9914-7DD559B7A417}";
|
private const string DRIVE_CLSID = "{935D1B74-9CB8-4e3c-9914-7DD559B7A417}";
|
||||||
|
private const string gPCUserExtensionNames = "[{00000000-0000-0000-0000-000000000000}{2EA1A81B-48E5-45E9-8BB7-A6E3AC170006}][{5794DAFD-BE60-433F-88A2-1A31939AC01F}{2EA1A81B-48E5-45E9-8BB7-A6E3AC170006}]";
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -1582,9 +1583,25 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (drives.Length == 0 && newDrive)
|
||||||
|
{
|
||||||
|
SetGPCUserExtensionNames(organizationId);
|
||||||
|
}
|
||||||
|
|
||||||
return exists;
|
return exists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetGPCUserExtensionNames(string organizationId)
|
||||||
|
{
|
||||||
|
string gpoName = string.Format("{0}-mapped-drives", organizationId);
|
||||||
|
|
||||||
|
DirectoryEntry de = ActiveDirectoryUtils.GetGroupPolicyContainer(gpoName);
|
||||||
|
|
||||||
|
ActiveDirectoryUtils.SetADObjectProperty(de, "gPCUserExtensionNames", gPCUserExtensionNames);
|
||||||
|
|
||||||
|
de.CommitChanges();
|
||||||
|
}
|
||||||
|
|
||||||
#region Drive Mapping Helpers
|
#region Drive Mapping Helpers
|
||||||
|
|
||||||
private void CreateDrivesXmlEmpty(string path, string fileName)
|
private void CreateDrivesXmlEmpty(string path, string fileName)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue