diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 39cac14c..56a70d39 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -67,8 +67,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices private const string Admins = "Admins"; private const string RdsGroupFormat = "rds-{0}-{1}"; private const string RdsModuleName = "RemoteDesktopServices"; - private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\""; - private const string WspAdministratorsGroupDescription = "WSP Org Administrators"; + private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\""; + private const string WspAdministratorsGroupDescription = "WSP RDS Collection Adminstrators"; + private const string RdsCollectionUsersGroupDescription = "WSP RDS Collection Users"; + private const string RdsCollectionComputersGroupDescription = "WSP RDS Collection Computers"; private const string RdsServersOU = "RDSServers"; private const string RdsServersRootOU = "RDSRootServers"; private const string RDSHelpDeskComputerGroup = "Websitepanel-RDSHelpDesk-Computer"; @@ -310,27 +312,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices EditRdsCollectionSettingsInternal(collection, runSpace); var orgPath = GetOrganizationPath(organizationId); - - if (!ActiveDirectoryUtils.AdObjectExists(GetComputerGroupPath(organizationId, collection.Name))) - { - //Create computer group - ActiveDirectoryUtils.CreateGroup(orgPath, GetComputersGroupName(collection.Name)); - - //todo Connection broker server must be added by default ??? - //ActiveDirectoryUtils.AddObjectToGroup(GetComputerPath(ConnectionBroker), GetComputerGroupPath(organizationId, collection.Name)); - } - + CheckOrCreateAdGroup(GetComputerGroupPath(organizationId, collection.Name), orgPath, GetComputersGroupName(collection.Name), RdsCollectionComputersGroupDescription); CheckOrCreateHelpDeskComputerGroup(); string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription); string groupName = GetLocalAdminsGroupName(collection.Name); string groupPath = GetGroupPath(organizationId, collection.Name, groupName); string localAdminsGroupSamAccountName = CheckOrCreateAdGroup(groupPath, GetOrganizationPath(organizationId), groupName, WspAdministratorsGroupDescription); - - if (!ActiveDirectoryUtils.AdObjectExists(GetUsersGroupPath(organizationId, collection.Name))) - { - //Create user group - ActiveDirectoryUtils.CreateGroup(orgPath, GetUsersGroupName(collection.Name)); - } + CheckOrCreateAdGroup(GetUsersGroupPath(organizationId, collection.Name), orgPath, GetUsersGroupName(collection.Name), RdsCollectionUsersGroupDescription); var capPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdCap); var rapPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdRap);