diff --git a/CHANGELOG.md b/CHANGELOG.md index 85ce1534..fb873eb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added support for VPN and IPv6Prefix boundaries to the CMBoundaries resource. - Updated module versions for SqlServerDsc, NetworkingDsc, ComputerManagementDsc +- Removed firewall configurations from the xSccmPreReqs resource. See + (Source\Examples\PrimaryInstall.ps1) for an example of firewall configurations. + +### Removed + +- Removed xSccmSql resource in favor of using the SQLSetup resource. See + (Source\Examples\PrimaryInstall.ps1) for an example of a SQL install configuration. ## [1.0.2] - 2021-05-12 diff --git a/README.md b/README.md index 3e6c37c4..a1c2027c 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,10 @@ is Import-ConfigMgrPowerShellModule. This project has adopted this [Code of Conduct](CODE_OF_CONDUCT.md). +## Change Log + +A full list of changes in each version can be found in the [Change Log](CHANGELOG.md). + ## Releases For each merge to the branch `master` a preview release will be @@ -53,7 +57,6 @@ Please check out common DSC Community [contributing guidelines](https://dsccommu - **xSccmPreReqs**: Provides a composite resource to install ADK, ADK WinPE, MDT, required Windows Features, modify Local Administrators group, and create the no_sms_on_drive files. -- **xSccmSqlSetup**: Provides a composite resource to install SQL for SCCM. - **xSccmInstall**: Provides a composite resource to install SCCM. - **ClientSettings**: Provides a resource to perform configuration of client settings. - **CMAccounts**: Provides a resource to manage Configuration Manager accounts. @@ -189,20 +192,9 @@ Please check out common DSC Community [contributing guidelines](https://dsccommu EnrollmentPoint | EnrollmentProxyPoint | FallbackServicePoint | ManagementPoint | ReportingServicesPoint | ServiceConnectionPoint | StateMigrationPoint | SoftwareUpdatePoint} -- **[Boolean] AddWindowsFirewallRule** : Specifies whether to add the Windows - Firewall Rules needed for the install. - Default Value: $false - **[String] WindowsFeatureSource** : Specifies the source that will be used to install windows features if the files are not present in the local side-by-side store. -- **[String[]] FirewallProfile** : Specifies the Windows Firewall profile for - the rules to be added. -- **[String[]] FirewallTcpLocalPort** : Specifies the TCP ports to be added to - the windows firewall as allowed. - Default Value: @('1433','1434','4022','445','135','139','49154-49157') -- **[String[]] FirewallUdpLocalPort** : Specifies the UDP ports to be added to - the windows firewall as allowed. - Default Value: @('137-138','1434','5355') - **[String] LocalAdministrators** : Specifies the accounts and/or groups you want to add to the local administrators group. - **[String] NoSmsOnDrives** : Specifies the drive letters of the drive you @@ -254,76 +246,6 @@ you are using apply and auto correct. - [SccmInstall](Source\Examples\Resources\xSccmInstall\SccmInstall.ps1) -### xSccmSqlSetup - -- **[String] SqlVersion** _(Required)_: Specify the version of SQL to be installed. - - Values: { 2008 | 2008R2 | 2012 | 2014 | 2016 | 2017 | 2019 } -- **[String] SqlInstallPath** _(Required)_: Specifies the path to the setup.exe - file for SQL. -- **[String] SqlInstanceName** _(Required)_: Specifies a SQL Server instance name. -- **[PSCredential] SqlServiceCredential** _(Required)_: Specifies the credential - for the service account used to run the SQL Service. -- **[PSCredential] SqlAgentServiceCredential** _(Required)_: Specifies the - credential for the service account used to run the SQL Agent Service. -- **[String] SqlSysAdminAccounts** _(Required)_: Use this parameter to provision - logins to be members of the sysadmin role. -- **[String]** : SQL features to install. - Default Value: 'SQLENGINE,RS,CONN,BC,SSMS,ADV_SSMS' -- **[String] InstallSharedDir** : Specifies the installation directory for - 64-bit shared components. - Default Value: 'C:\Program Files\Microsoft SQL Server' -- **[String] InstallSharedWowDir** : Specifies the installation directory for - 32-bit shared components. Supported only on a 64-bit system. - Default Value: 'C:\Program Files (x86)\Microsoft SQL Server' -- **[String] InstanceDir** : Specifies the installation path for SQL Server - instance files. - Default Value: 'C:\Program Files\Microsoft SQL Server' -- **[String] RSSvcStartupType** : Specifies the startup mode for Reporting Services. - Default Value: 'Automatic' -- **[String] AgtSvcStartupType** : Specifies the startup mode for the SQL Server - Agent service. - Default Value: 'Automatic' -- **[String] RSInstallMode** : Specifies the Install mode for Reporting Services. - Default Value: 'DefaultNativeMode' -- **[String] SqlCollation** : Specifies the collation settings for SQL Server. - Default Value: 'SQL_Latin1_General_CP1_CI_AS' -- **[String] InstallSqlDataDir** : Specifies the data directory for SQL Server - data files. - Default Value: 'C:\' -- **[String] SqlUserDBDir** : Specifies the directory for the data - files for user databases. - Default Value: '\\MSSQL\Data' -- **[String] SqlUserDBLogDir** : Specifies the directory for the log - files for user databases. - Default Value: '\\MSSQL\Data' -- **[String] SqlTempDBDir** : Specifies the directory for the data - files for tempdb. - Default Value: '\\MSSQL\Data' -- **[String] SqlTempDBLogDir** : Specifies the directory for the log - files for tempdb. - Default Value: '\\MSSQL\Data' -- **[String] UpdateEnabled** : Specify whether SQL Server setup should discover - and include product updates. - Default Value: $false -- **[String] SqlPort** : Specifies the port SQL listens on. - Default Value: 1433 -- **[String] InstallManagementStudio** : Specify whether to install SQL - Management Studio. - Default Value: $false -- **[String] SqlManagementStudioExePath** : Specify that path and filename to - the exe for Management Studio instal. -- **[String] SqlManagementStudioName** : Specify the name of SQL Server - Management Studio. - Default Value: 'SQL Server Management Studio' -- **[String] SqlManagementStudioProductId** : Specify the product if of the SQL - Management Studio install being performed. - Default Value: 'E3FD687D-6757-474B-8D83-5AA944B02C58' - -#### xSccmSqlSetup Examples - -- [SccmSqlSetup](Source\Examples\Resources\xSccmSqlSetup\SccmSqlSetup.ps1) -- [SccmSqlSetupandManagemenStudio](Source\Examples\Resources\xSccmSqlSetup\SccmSqlSetupAndManagementStudio.ps1) - ### CMAccounts - **[String] SiteCode** _(Key)_: Specifies the Site Code for the Configuration diff --git a/source/DSCResources/xSccmPreReqs/xSccmPreReqs.schema.psm1 b/source/DSCResources/xSccmPreReqs/xSccmPreReqs.schema.psm1 index 9f21b4f0..02c96b6f 100644 --- a/source/DSCResources/xSccmPreReqs/xSccmPreReqs.schema.psm1 +++ b/source/DSCResources/xSccmPreReqs/xSccmPreReqs.schema.psm1 @@ -35,18 +35,6 @@ .PARAMETER SccmRole Specify the SCCM Roles that will be on the server. - .PARAMETER AddWindowsFirewallRule - Specify whether to add the Windows Firewall Rules needed for the install. - - .PARAMETER FirewallProfile - Specify the Windows Firewall profile for the rules to be added. - - .PARAMETER FirewallTcpLocalPort - Specify the TCP ports to be added to the windows firewall as allowed. - - .PARAMETER FirewallUdpLocalPort - Specify the UDP ports to be added to the windows firewall as allowed. - .PARAMETER LocalAdministrators Specifies the accounts and/or groups you want to add to the local administrators group. @@ -131,22 +119,6 @@ Configuration xSCCMPreReqs [System.String[]] $SccmRole = 'CASorSiteServer', - [Parameter()] - [Boolean] - $AddWindowsFirewallRule = $false, - - [Parameter()] - [System.String[]] - $FirewallProfile, - - [Parameter()] - [System.String[]] - $FirewallTcpLocalPort = @('1433','1434','4022','445','135','139','49154-49157'), - - [Parameter()] - [System.String[]] - $FirewallUdpLocalPort = @('137-138','1434','5355'), - [Parameter()] [System.String[]] $LocalAdministrators, @@ -193,7 +165,6 @@ Configuration xSCCMPreReqs ) Import-DscResource -ModuleName PSDesiredStateConfiguration - Import-DscResource -ModuleName NetworkingDsc -ModuleVersion 8.2.0 $features = @() foreach ($role in $SccmRole) @@ -257,40 +228,6 @@ Configuration xSCCMPreReqs } } - if ($AddWindowsFirewallRule) - { - if ($null -eq $FirewallProfile) - { - throw 'When specifying AddWindowsFirewallRule you need to provide FirewallProfile, FirewallTcpLocalPort, and FirewallUdpLocalPort.' - } - - Firewall AddSccmTCPFirewallRule - { - Name = 'SCCMServerTCP' - DisplayName = 'SCCM to SCCM communication - TCP' - Ensure = 'Present' - Enabled = 'True' - Profile = $FirewallProfile - Direction = 'Inbound' - LocalPort = $FirewallTcpLocalPort - Protocol = 'TCP' - Description = 'Firewall Rule SCCM to SCCM communication - TCP' - } - - Firewall AddSccmUdpFirewallRule - { - Name = 'SCCMServerUDP' - DisplayName = 'SCCM to SCCM communication - UDP' - Ensure = 'Present' - Enabled = 'True' - Profile = $FirewallProfile - Direction = 'Inbound' - LocalPort = $FirewallUdpLocalPort - Protocol = 'UDP' - Description = 'Firewall Rule SCCM to SCCM communication - UDP' - } - } - $domainAccounts = $Localadministrators | Where-Object -FilterScript {$_ -like '*\*' -and $_ -notlike 'BUILTIN\*' -and $_ -notlike '.\*' -and $_ -notlike '*@*'} if ($domainAccounts -gt 0) diff --git a/source/DSCResources/xSccmSqlSetup/xSccmSqlSetup.psd1 b/source/DSCResources/xSccmSqlSetup/xSccmSqlSetup.psd1 deleted file mode 100644 index 573be714..00000000 --- a/source/DSCResources/xSccmSqlSetup/xSccmSqlSetup.psd1 +++ /dev/null @@ -1,113 +0,0 @@ -@{ - - # Script module or binary module file associated with this manifest. - RootModule = 'xSccmSqlSetup.schema.psm1' - - # Version number of this module. - ModuleVersion = '1.0.0' - - # Supported PSEditions - # CompatiblePSEditions = @() - - # ID used to uniquely identify this module - GUID = '04a77205-ac4d-4e06-b199-d5298567fbd1' - - # Author of this module - Author = 'DSC Community' - - # Company or vendor of this module - CompanyName = 'DSC Community' - - # Copyright statement for this module - Copyright = 'Copyright the DSC Community contributors. All rights reserved.' - - # Description of the functionality provided by this module - # Description = '' - - # Minimum version of the Windows PowerShell engine required by this module - # PowerShellVersion = '' - - # Name of the Windows PowerShell host required by this module - # PowerShellHostName = '' - - # Minimum version of the Windows PowerShell host required by this module - # PowerShellHostVersion = '' - - # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. - # DotNetFrameworkVersion = '' - - # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. - # CLRVersion = '' - - # Processor architecture (None, X86, Amd64) required by this module - # ProcessorArchitecture = '' - - # Modules that must be imported into the global environment prior to importing this module - # RequiredModules = @() - - # Assemblies that must be loaded prior to importing this module - # RequiredAssemblies = @() - - # Script files (.ps1) that are run in the caller's environment prior to importing this module. - # ScriptsToProcess = @() - - # Type files (.ps1xml) to be loaded when importing this module - # TypesToProcess = @() - - # Format files (.ps1xml) to be loaded when importing this module - # FormatsToProcess = @() - - # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess - # NestedModules = @() - - # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. - FunctionsToExport = '*' - - # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. - CmdletsToExport = '*' - - # Variables to export from this module - VariablesToExport = '*' - - # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. - AliasesToExport = '*' - - # DSC resources to export from this module - # DscResourcesToExport = @() - - # List of all modules packaged with this module - # ModuleList = @() - - # List of all files packaged with this module - # FileList = @() - - # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. - PrivateData = @{ - - PSData = @{ - - # Tags applied to this module. These help with module discovery in online galleries. - # Tags = @() - - # A URL to the license for this module. - # LicenseUri = '' - - # A URL to the main website for this project. - # ProjectUri = '' - - # A URL to an icon representing this module. - # IconUri = '' - - # ReleaseNotes of this module - # ReleaseNotes = '' - - } # End of PSData hashtable - - } # End of PrivateData hashtable - - # HelpInfo URI of this module - # HelpInfoURI = '' - - # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. - # DefaultCommandPrefix = '' -} diff --git a/source/DSCResources/xSccmSqlSetup/xSccmSqlSetup.schema.psm1 b/source/DSCResources/xSccmSqlSetup/xSccmSqlSetup.schema.psm1 deleted file mode 100644 index ab87779a..00000000 --- a/source/DSCResources/xSccmSqlSetup/xSccmSqlSetup.schema.psm1 +++ /dev/null @@ -1,322 +0,0 @@ -<# - .SYNOPSIS - A DSC composite resource to configure a basic installation of Microsoft SQL Server for 2014 SCCM Servers. - - .PARAMETER SqlVersion - Specify the version of SQL to be installed. - - .PARAMETER SqlInstallPath - Specifies the path to the setup.exe file for SQL. - - .PARAMETER SqlInstanceName - Specifies a SQL Server instance name. - - .PARAMETER SqlServiceCredential - Specifies the credential for the service account used to run the SQL Service. - - .PARAMETER SqlAgentServiceCredential - Specifies the credential for the service account used to run the SQL Agent Service. - - .PARAMETER SqlSysAdminAccounts - Use this parameter to provision logins to be members of the sysadmin role. - - .PARAMETER Features - SQL features to install. - - .PARAMETER InstallSharedDir - Specifies the installation directory for 64-bit shared components. - - .PARAMETER InstallSharedWowDir - Specifies the installation directory for 32-bit shared components. Supported only on a 64-bit system. - - .PARAMETER InstanceDir - Specifies the installation path for SQL Server instance files. - - .PARAMETER RSSvcStartupType - Specifies the startup mode for Reporting Services. - - .PARAMETER AgtSvcStartupType - Specifies the startup mode for the SQL Server Agent service. - - .PARAMETER RSInstallMode - Specifies the Install mode for Reporting Services. - Supported Values: - SharePointFilesOnlyMode - DefaultNativeMode - FilesOnlyMode - Note: - If the installation includes the SQL Server Database engine, the default RSInstallMode is DefaultNativeMode. - If the installation does not include the SQL Server Database engine, the default RSInstallMode is FilesOnlyMode. - If you choose DefaultNativeMode but the installation does not include the SQL Server Database engine, - the installation will automatically change the RSInstallMode to FilesOnlyMode. - - .PARAMETER SqlCollation - Specifies the collation settings for SQL Server. - - .PARAMETER InstallSqlDataDir - Specifies the data directory for SQL Server data files. - - .PARAMETER SqlUserDBDir - Specifies the directory for the data files for user databases. - - .PARAMETER SqlUserDBLogDir - Specifies the directory for the log files for user databases. - - .PARAMETER SqlTempDBDir - Specifies the directory for the data files for tempdb. - - .PARAMETER SqlTempDBLogDir - Specifies the directory for the log files for tempdb. - - .PARAMETER UpdateEnabled - Specify whether SQL Server setup should discover and include product updates. - - .PARAMETER SqlPort - Specifies the port SQL listens on. - - .PARAMETER InstallManagementStudio - Specify whether to install SQL Management Studio. - - .PARAMETER SqlManagementStudioExePath - Specify that path and filename to the exe for Management Studio instal. - - .PARAMETER SqlManagementStudioName - Specify the name of SQL Server Management Studio. - Default is 'SQL Server Management Studio'. - - .PARAMETER SqlManagementStudioProductId - Specify the product if of the SQL Management Studio install being performed. - Defaults to 18.5 ProductID. -#> -Configuration xSccmSqlSetup -{ - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullorEmpty()] - [ValidateSet('2008', '2008R2','2012','2014','2016','2017','2019')] - [String] - $SqlVersion, - - [Parameter(Mandatory = $true)] - [ValidateNotNullorEmpty()] - [String] - $SqlInstallPath, - - [Parameter(Mandatory = $true)] - [ValidateNotNullorEmpty()] - [String] - $SqlInstanceName, - - [Parameter(Mandatory = $true)] - [ValidateNotNullorEmpty()] - [PSCredential] - $SqlServiceCredential, - - [Parameter(Mandatory = $true)] - [ValidateNotNullorEmpty()] - [PSCredential] - $SqlAgentServiceCredential, - - [Parameter(Mandatory = $true)] - [ValidateNotNullorEmpty()] - [String[]] - $SqlSysAdminAccounts, - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $Features = 'SQLENGINE,RS,CONN,BC,SSMS,ADV_SSMS', - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $InstallSharedDir = 'C:\Program Files\Microsoft SQL Server', - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $InstallSharedWowDir = 'C:\Program Files (x86)\Microsoft SQL Server', - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $InstanceDir = 'C:\Program Files\Microsoft SQL Server', - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $RSSvcStartupType = 'Automatic', - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $AgtSvcStartupType = 'Automatic', - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $RSInstallMode = 'DefaultNativeMode', - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $SqlCollation = 'SQL_Latin1_General_CP1_CI_AS', - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $InstallSqlDataDir = 'C:\', - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $SqlUserDBDir, - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $SqlUserDBLogDir, - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $SqlTempDBDir, - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $SqlTempDBLogDir, - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $UpdateEnabled = $false, - - [Parameter()] - [ValidateNotNullorEmpty()] - [Uint16] - $SqlPort = 1433, - - [Parameter()] - [ValidateNotNullorEmpty()] - [Boolean] - $InstallManagementStudio = $false, - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $SqlManagementStudioExePath, - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $SqlManagementStudioName = 'SQL Server Management Studio', - - [Parameter()] - [ValidateNotNullorEmpty()] - [String] - $SqlManagemenStudioProductId = 'E3FD687D-6757-474B-8D83-5AA944B02C58' - ) - - Import-DscResource -ModuleName PSDesiredStateConfiguration - Import-DscResource -ModuleName SqlServerDsc -ModuleVersion 15.2.0 - - switch ($SqlVersion) - { - '2008' { $version = '10' } - '2008R2' { $version = '10' } - '2012' { $version = '11' } - '2014' { $version = '12' } - '2016' { $version = '13' } - '2017' { $version = '14' } - '2019' { $version = '15' } - } - - if ($SqlTempDBDir) - { - $finalSqlTempDBDir = $SqlTempDBDir - } - else - { - $finalSqlTempDBDir = "$InstallSqlDataDir\MSSQL$version.$SqlInstanceName\MSSQL\Data" - } - - if ($SqlTempDBLogDir) - { - $finalSqlTempDBLogDir = $SqlTempDBLogDir - } - else - { - $finalSqlTempDBLogDir = "$InstallSqlDataDir\MSSQL$version.$SqlInstanceName\MSSQL\Data" - } - - if ($SqlUserDBDir) - { - $finalSqlUserDBDir = $SqlUserDBDir - } - else - { - $finalSqlUserDBDir = "$InstallSqlDataDir\MSSQL$version.$SqlInstanceName\MSSQL\Data" - } - - if ($SqlUserDBLogDir) - { - $finalSqlUserDBLogDir = $SqlUserDBLogDir - } - else - { - $finalSqlUserDBLogDir = "$InstallSqlDataDir\MSSQL$version.$SqlInstanceName\MSSQL\Data" - } - - SqlSetup InstallSql - { - Features = $Features - InstallSharedDir = $InstallSharedDir - InstallSharedWowDir = $InstallSharedWowDir - InstanceDir = $InstanceDir - InstanceName = $SqlInstanceName - SQLSvcAccount = $SqlServiceCredential - AgtSvcAccount = $SqlAgentServiceCredential - RSInstallMode = $RSInstallMode - RSSVCStartUpType = $RSSVCStartUpType - AgtSvcStartupType = $AgtSvcStartupType - SQLCollation = $SqlCollation - SQLSysAdminAccounts = $SqlSysAdminAccounts - InstallSQLDataDir = $InstallSqlDataDir - SQLUserDBDir = $finalSqlUserDBDir - SQLUserDBLogDir = $finalSqlUserDBLogDir - SQLTempDBDir = $finalSqlTempDBDir - SQLTempDBLogDir = $finalSqlTempDBLogDir - SourcePath = $SqlInstallPath - UpdateEnabled = $UpdateEnabled - } - - SqlProtocolTcpIp SetTcpIpPort - { - InstanceName = $SqlInstanceName - IpAddressGroup = 'IPAll' - TcpPort = $SqlPort - DependsOn = '[SqlSetup]InstallSql' - } - - if ($InstallManagementStudio) - { - if ($null -eq $SqlManagementStudioExePath) - { - Write-Error -Message $('When specifying to Install SQL Management Studio, you need to provide ' + - 'SqlManagementStudioExePath.') - } - - Package InstallSqlManagementStudio - { - Ensure = 'Present' - Path = $SqlManagementStudioExePath - Name = $SqlManagementStudioName - Arguments = '/install /quiet /norestart' - ProductId = $SqlManagemenStudioProductId - DependsOn = '[SqlProtocolTcpIp]SetTcpIpPort' - } - } -} diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index de328348..e29b884f 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -121,8 +121,6 @@ Configuration PrimaryInstall InstallWindowsFeatures = $true WindowsFeatureSource = 'C:\Windows\WinSxS' SccmRole = 'CASorSiteServer','ManagementPoint','DistributionPoint','SoftwareUpdatePoint' - AddWindowsFirewallRule = $true - FirewallProfile = 'Domain','Private' LocalAdministrators = @('contoso\SCCM-Servers','contoso\SCCM-CMInstall','contoso\Admin') DomainCredential = $DomainCredential AdkInstallPath = 'C:\Apps\ADK' @@ -133,29 +131,66 @@ Configuration PrimaryInstall AdkWinPeProductID = $winPeProductID } - xSccmSqlSetup SCCMSqlInstall - { - SqlVersion = '2014' - Features = 'SQLENGINE,RS,CONN,BC,SSMS,ADV_SSMS' - InstallSharedDir = 'C:\Apps\Microsoft SQL Server' - InstallSharedWowDir = 'C:\Apps (x86)\Microsoft SQL Server' - InstanceDir = 'C:\Apps\Microsoft SQL Server' - SqlInstanceName = $dbInstanceName - SqlServiceCredential = $SqlServiceCredential - SqlAgentServiceCredential = $SqlAgentServiceCredential - RSInstallMode = 'DefaultNativeMode' - RSSVCStartUpType = 'Automatic' - AgtSvcStartupType = 'Automatic' - SQLCollation = 'SQL_Latin1_General_CP1_CI_AS' - SQLSysAdminAccounts = @('contoso\SCCM-Servers','contoso\Admin','contoso\SCCM-CMInstall') - InstallSQLDataDir = "C:" - SQLUserDBDir = "C:\MSSQL12.$dbInstanceName\MSSQL\Data\App" - SQLUserDBLogDir = "C:\MSSQL12.$dbInstanceName\MSSQL\Log\App" - SQLTempDBDir = "C:\MSSQL12.$dbInstanceName\MSSQL\Data\System" - SQLTempDBLogDir = "C:\MSSQL12.$dbInstanceName\MSSQL\Log\System" - SqlInstallPath = 'C:\temp\SQL\MSSQL2014wSP3' - UpdateEnabled = $false - DependsOn = '[xSccmPreReqs]SCCMPreReqs' + Firewall AddSccmTCPFirewallRule + { + Name = 'SCCMServerTCP' + DisplayName = 'SCCM to SCCM communication - TCP' + Ensure = 'Present' + Enabled = 'True' + Profile = 'Domain','Private' + Direction = 'Inbound' + LocalPort = '1433','1434','4022','445','135','139','49154-49157' + Protocol = 'TCP' + Description = 'Firewall Rule SCCM to SCCM communication - TCP' + DependsOn = '[xSccmPreReqs]SCCMPreReqs' + } + + Firewall AddSccmUdpFirewallRule + { + Name = 'SCCMServerUDP' + DisplayName = 'SCCM to SCCM communication - UDP' + Ensure = 'Present' + Enabled = 'True' + Profile = 'Domain','Private' + Direction = 'Inbound' + LocalPort = '137-138','1434','5355' + Protocol = 'UDP' + Description = 'Firewall Rule SCCM to SCCM communication - UDP' + DependsOn = '[Firewall]AddSccmTCPFirewallRule' + } + + SQLSetup SCCMSqlInstall + { + Features = 'SQLENGINE,RS,CONN,BC,SSMS,ADV_SSMS' + InstallSharedDir = 'C:\Apps\Microsoft SQL Server' + InstallSharedWowDir = 'C:\Apps (x86)\Microsoft SQL Server' + InstanceDir = 'C:\Apps\Microsoft SQL Server' + InstanceName = $dbInstanceName + SQLSvcAccount = $SqlServiceCredential + AgtSvcAccount = $SqlAgentServiceCredential + RSInstallMode = 'DefaultNativeMode' + RSSVCStartUpType = 'Automatic' + AgtSvcStartupType = 'Automatic' + SQLCollation = 'SQL_Latin1_General_CP1_CI_AS' + SQLSysAdminAccounts = @('contoso\SCCM-Servers','contoso\Admin','contoso\SCCM-CMInstall') + InstallSQLDataDir = 'C:' + SQLUserDBDir = "C:\MSSQL12.$dbInstanceName\MSSQL\Data\App" + SQLUserDBLogDir = "C:\MSSQL12.$dbInstanceName\MSSQL\Log\App" + SQLTempDBDir = "C:\MSSQL12.$dbInstanceName\MSSQL\Data\System" + SQLTempDBLogDir = "C:\MSSQL12.$dbInstanceName\MSSQL\Log\System" + SourcePath = 'C:\temp\SQL\MSSQL2014wSP3' + UpdateEnabled = $false + DependsOn = '[Firewall]AddSccmUdpFirewallRule' + } + + SqlServerNetwork EnableTcpIp + { + InstanceName = $dbInstanceName + ProtocolName = 'Tcp' + IsEnabled = $true + TcpPort = 1433 + RestartService = $true + DependsOn = '[SqlSetup]SCCMSqlInstall' } # WSUS registry value to fix issues with WSUS self-signed certificates @@ -184,7 +219,7 @@ Configuration PrimaryInstall Classifications = '*' UpstreamServerSSL = $false Synchronize = $false - DependsOn = '[File]WSUSUpdates','[xSccmPreReqs]SCCMPreReqs','[Registry]EnableWSUSSelfSignedCert' + DependsOn = '[File]WSUSUpdates','[Firewall]AddSccmUdpFirewallRule','[Registry]EnableWSUSSelfSignedCert' } File CreateIniFolder @@ -192,7 +227,7 @@ Configuration PrimaryInstall Ensure = 'Present' Type = 'Directory' DestinationPath = 'C:\SetupFiles' - DependsOn = '[xSccmSqlSetup]SCCMSqlInstall' + DependsOn = '[SQLSetup]SCCMSqlInstall' } CMIniFile CreateSCCMIniFile diff --git a/source/Examples/Resources/xSccmPreReqs/SccmPreReqs.ps1 b/source/Examples/Resources/xSccmPreReqs/SccmPreReqs.ps1 index 4177fe4b..75eb1394 100644 --- a/source/Examples/Resources/xSccmPreReqs/SccmPreReqs.ps1 +++ b/source/Examples/Resources/xSccmPreReqs/SccmPreReqs.ps1 @@ -25,8 +25,6 @@ Configuration Example InstallMdt = $true InstallWindowsFeatures = $true SccmRole = 'CASorSiteServer' - AddWindowsFirewallRule = $true - FirewallProfile = 'Domain','Private' AdkSetupExePath = 'C:\temp\ADKInstall\adksetup.exe' AdkWinPeSetupPath = 'C:\temp\ADKInstall\adkwinpesetup.exe' MdtMsiPath = 'C:\temp\MDTInstall\MicrosoftDeploymentToolkit_x64_1809.msi' diff --git a/source/Examples/Resources/xSccmSqlSetup/SccmSqlSetup.ps1 b/source/Examples/Resources/xSccmSqlSetup/SccmSqlSetup.ps1 deleted file mode 100644 index b8ae5805..00000000 --- a/source/Examples/Resources/xSccmSqlSetup/SccmSqlSetup.ps1 +++ /dev/null @@ -1,36 +0,0 @@ -#Requires -Module ConfigMgrCBDsc - -<# - .DESCRIPTION - This configuration Install SQL for an SCCM install. The DSC resource module, SqlServerDsc, can be used to - create a more sophisticated install. -#> -Configuration Example -{ - [CmdletBinding()] - param - ( - [Parameter()] - [System.Management.Automation.PSCredential] - $SqlServiceCredential, - - [Parameter()] - [System.Management.Automation.PSCredential] - $SqlAgentServiceCredential - ) - - Import-DscResource -ModuleName ConfigMgrCBDsc - - Node localhost - { - xSccmSqlSetup SccmSqlSetup - { - SqlVersion = '2014' - SqlInstanceName = 'CASINST01' - SqlServiceCredential = $SqlServiceCredential - SqlAgentServiceCredential = $SqlAgentServiceCredential - SqlSysAdminAccounts = @('contoso\SqlAdmin01','contoso\SqlAdmin02','contoso\SqlAdminGroup') - SqlInstallPath = 'C:\Windows\Temp\SQL\MSSQL2014wSP3' - } - } -} diff --git a/source/Examples/Resources/xSccmSqlSetup/SccmSqlSetupAndManagementStudio.ps1 b/source/Examples/Resources/xSccmSqlSetup/SccmSqlSetupAndManagementStudio.ps1 deleted file mode 100644 index 464d5337..00000000 --- a/source/Examples/Resources/xSccmSqlSetup/SccmSqlSetupAndManagementStudio.ps1 +++ /dev/null @@ -1,38 +0,0 @@ -#Requires -Module ConfigMgrCBDsc - -<# - .DESCRIPTION - This configuration Install SQL for an SCCM install. The DSC resource module, SqlServerDsc, can be used to - create a more sophisticated install. -#> -Configuration Example -{ - [CmdletBinding()] - param - ( - [Parameter()] - [System.Management.Automation.PSCredential] - $SqlServiceCredential, - - [Parameter()] - [System.Management.Automation.PSCredential] - $SqlAgentServiceCredential - ) - - Import-DscResource -ModuleName ConfigMgrCBDsc - - Node localhost - { - xSccmSqlSetup SccmSqlSetupAndManagementStudio - { - SqlVersion = '2014' - SqlInstanceName = 'CASINST01' - SqlServiceCredential = $SqlServiceCredential - SqlAgentServiceCredential = $SqlAgentServiceCredential - SqlSysAdminAccounts = @('contoso\SqlAdmin01','contoso\SqlAdmin02','contoso\SqlAdminGroup') - SqlInstallPath = 'C:\Windows\Temp\SQL\MSSQL2014wSP3' - InstallManagementStudio = $true - SqlManagementStudioExePath = 'C:\Windows\temp\SSMS18_5\SSMS-Setup-ENU.exe' - } - } -}