diff --git a/CHANGELOG.md b/CHANGELOG.md index ecbfb38..95e5ffe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added SccmIniFile resource +- Added xSccmInstall examples +- Added xSccmSql examples +- Added xSccmPreReq examples - Added CMCollections Resource - Added Set-ConfigMgrCert to the ResourceHelper - Added CMBoundaries resource diff --git a/README.md b/README.md index ddd3d2f..3af7d10 100644 --- a/README.md +++ b/README.md @@ -48,12 +48,18 @@ Please check out common DSC Community [contributing guidelines](https://dsccommu ## Resources +- **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 reosurce to install SCCM. +- **ClientSettings**: Provides a resource to perform configuration of client settings. - **CMAccounts**: Provides a resource to manage Configuration Manager accounts. - **CMIniFile** This resource allows for the creation of the ini file used during the SCCM install, for CAS and Primary. - **CMCollections**: Provides a resource for creating collections and collection queries, direct, and exclude membership rules. -- **CMBoundaries**: Provides a resource for creating and removing boundaries. + - **CMBoundaries**: Provides a resource for creating and removing boundaries. - **CMForestDiscovery**: Provides a resource to manage the Configuration Manager AD Forest Discovery method. - **CMClientStatusSettings**: Provides a resource for modifying configuration @@ -75,6 +81,151 @@ Please check out common DSC Community [contributing guidelines](https://dsccommu - **CMServiceConnectionPoint**: Provides a resource for creating and managing the SCCM Service Connection Point role. +### xSccmPreReqs + +- **[Boolean] InstallADK** : Specifies whether to install ADK. + Default Value: $true +- **[Boolean] InstallMDT** : Specifies whether to install MDT. +- **[String] AdkSetupExePath** : Specifies the path and filename to + the ADK Setup. +- **[String] AdkWinPeSetupPath** : Specifies the path and filename + to the ADK WinPE Setup. +- **[String] MdtMsiPath** : Specifies the path and filename to the + MDT Setup. +- **[String] InstallWindowsFeatures** : Specifies to install Windows Features + needed for the SCCM install. +- **[String[]] SccmRole** : Specifies the SCCM Roles that will be on the server. + Default Value: CASorSiteServer + - Values{CASorSiteServer | AssetIntelligenceSynchronizationPoint | + CertificateRegistrationPoint | DistributionPoint | EndpointProtectionPoint | + 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','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 + don't want SCCM to install on. +- **[PSCredential] DomainCredential** : Specifies credentials that have domain + read permissions to add domain users or groups to the local administrators group. +- **[String] AdkProductName** : Specifies the Product Name for ADK. + Default Value: 'Windows Assessment and Deployment Kit - Windows 10' +- **[String] AdkProductID** : Specifies the Product ID for ADK. + Default Value: 'fb450356-9879-4b2e-8dc9-282709286661' +- **[String] AdkWinPeProductName** : Specifies the Product Name for ADK WinPE. + Default Value: 'Windows Assessment and Deployment Kit Windows Preinstallation + Environment Add-ons - Windows 10' +- **[String] AdkWinPeProductID** : Specifies the Product ID for ADK WinPE. + Default Value: 'd8369a05-1f4a-4735-9558-6e131201b1a2' +- **[String] AdkInstallPath** : Specifies the path to install ADK and ADK WinPE. + Default Value: 'C:\Program Files (x86)\Windows Kits\10' +- **[String] MdtProductName** : Specifies the Product Name for MDT. + Default Value: 'Microsoft Deployment Toolkit (6.3.8456.1000)' +- **[String] MdtProductID** : Specifies the Product ID for MDT. + Default Value: '2E6CD7B9-9D00-4B04-882F-E6971BC9A763' +- **[String] MdtInstallPath** : Specifies the path to install MDT. + Default Value: 'C:\Program Files\Microsoft Deployment Toolkit' + +#### xSccmPreReqs Examples + +- [SccmPreReqs](Source\Examples\Resources\xSccmPreReqs\SccmPreReqs.ps1) + +### xSccmInstall + +- **[String] SetupExePath** _(Required)_: Specifies the path to the setup.exe + for SCCM. +- **[String] IniFile** _(Required)_: Specifies the path of the ini file, to include + the filename. +- **[String] SccmServerType** _(Required)_: Specifies the SCCM Server type install, + CAS or Primary. + - Values: { CAS | Primary } +- **[PSCredential] SccmInstallAccount** _(Required)_: Specifies the credentials to + use for the SCCM install. + +#### xSccmInstall Examples + +- [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] 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/RequiredModules.psd1 b/RequiredModules.psd1 index 0b301d9..3e0a3f0 100644 --- a/RequiredModules.psd1 +++ b/RequiredModules.psd1 @@ -22,5 +22,6 @@ # Build dependent modules 'DscResource.Common' = 'latest' + 'SqlServerDsc' = '14.0.0' + 'NetworkingDsc' = '7.4.0.0' } - diff --git a/source/ConfigMgrCBDsc.psd1 b/source/ConfigMgrCBDsc.psd1 index a2111cb..2055f7a 100644 --- a/source/ConfigMgrCBDsc.psd1 +++ b/source/ConfigMgrCBDsc.psd1 @@ -43,6 +43,10 @@ # DSC resources to export from this module DscResourcesToExport = @( 'CMAccounts' + 'SccmIniFile' + 'XSccmInstall' + 'xSccmPreReqs' + 'xSccmSqlSetup' 'CMIniFile' 'CMCollections' 'CMBoundaries' @@ -68,9 +72,10 @@ Prerelease = '' # Tags applied to this module. These help with module discovery in online galleries. - Tags = @('DesiredStateConfiguration', 'DSC', 'DSCResourceKit', 'DSCResource', 'ConfigMgrCBDsc','CMAccounts','CMIniFile','Collections', - 'Boundaries','ForestDiscovery','ClientStatusSettings','BoundaryGroups','ManagementPoint','AssetIntelligencePoint','FallbackStatusPoint', - 'SoftwareUpdatePoint','DistrubtionPoint','HeartbeatDiscovery','ServiceConnectionPoint') + Tags = @('DesiredStateConfiguration', 'DSC', 'DSCResourceKit', 'DSCResource', 'ConfigMgrCBDsc','CMAccounts','SCCMPreReqs', + 'SccmSqlSetup','SCCMInstall','CMIniFile','Collections','Boundaries','ForestDiscovery','ClientStatusSettings','BoundaryGroups', + 'ManagementPoint','AssetIntelligencePoint','FallbackStatusPoint','SoftwareUpdatePoint','DistrubtionPoint','HeartbeatDiscovery', + 'ServiceConnectionPoint') # A URL to the license for this module. LicenseUri = 'https://github.com/dsccommunity/ConfigMgrCBDsc/blob/master/LICENSE' diff --git a/source/DSCResources/xSccmInstall/xSccmInstall.psd1 b/source/DSCResources/xSccmInstall/xSccmInstall.psd1 new file mode 100644 index 0000000..6129df5 --- /dev/null +++ b/source/DSCResources/xSccmInstall/xSccmInstall.psd1 @@ -0,0 +1,113 @@ +@{ + + # Script module or binary module file associated with this manifest. + RootModule = 'xSccmInstall.schema.psm1' + + # Version number of this module. + ModuleVersion = '1.0.0' + + # Supported PSEditions + # CompatiblePSEditions = @() + + # ID used to uniquely identify this module + GUID = '6af6ba9f-8084-40e0-8fa9-8dab37296a73' + + # 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/xSccmInstall/xSccmInstall.schema.psm1 b/source/DSCResources/xSccmInstall/xSccmInstall.schema.psm1 new file mode 100644 index 0000000..7893589 --- /dev/null +++ b/source/DSCResources/xSccmInstall/xSccmInstall.schema.psm1 @@ -0,0 +1,61 @@ +<# + .SYNOPSIS + A DSC composite resource to install SCCM. + + .PARAMETER SetupExePath + Specifies the path to the setup.exe for SCCM. + + .PARAMETER IniFile + Specifies the path of the ini file, to include the filename. + + .PARAMETER SccmServerType + Specifies the SCCM Server type install, CAS or Primary. + + .PARAMETER SccmInstallAccount + Specifies the credentials to use for the SCCM install. +#> +Configuration xSCCMInstall +{ + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [System.String] + $SetupExePath, + + [Parameter(Mandatory = $true)] + [System.String] + $IniFile, + + [Parameter(Mandatory = $true)] + [ValidateSet('CAS', 'Primary')] + [System.String] + $SccmServerType, + + [Parameter(Mandatory = $true)] + [System.Management.Automation.PSCredential] + $SccmInstallAccount + ) + + Import-DscResource -ModuleName PSDesiredStateConfiguration + + if ($SccmServerType -eq 'CAS') + { + $productName = 'System Center Configuration Manager Central Administration Site Setup' + } + if ($SccmServerType -eq 'Primary') + { + $productName = 'System Center Configuration Manager Primary Site Setup' + } + + Package SCCM + { + Ensure = 'Present' + Path = "$SetupExePath\Setup.exe" + Name = $productName + ProductId = '' + Arguments = "/SCRIPT $IniFile" + DependsOn = $dependsOnChain + PsDscRunAsCredential = $SccmInstallAccount + } +} diff --git a/source/DSCResources/xSccmPreReqs/xSccmPreReqs.psd1 b/source/DSCResources/xSccmPreReqs/xSccmPreReqs.psd1 new file mode 100644 index 0000000..26fdc53 --- /dev/null +++ b/source/DSCResources/xSccmPreReqs/xSccmPreReqs.psd1 @@ -0,0 +1,113 @@ +@{ + + # Script module or binary module file associated with this manifest. + RootModule = 'xSccmPreReqs.schema.psm1' + + # Version number of this module. + ModuleVersion = '1.0.0' + + # Supported PSEditions + # CompatiblePSEditions = @() + + # ID used to uniquely identify this module + GUID = 'cb715caa-890d-47de-83f6-c9c072ca7e61' + + # 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/xSccmPreReqs/xSccmPreReqs.schema.psm1 b/source/DSCResources/xSccmPreReqs/xSccmPreReqs.schema.psm1 new file mode 100644 index 0000000..62a62fc --- /dev/null +++ b/source/DSCResources/xSccmPreReqs/xSccmPreReqs.schema.psm1 @@ -0,0 +1,376 @@ +<# + .SYNOPSIS + A DSC composite resource to configure/install the required PreReqs for SCCM. + - .NET Framework 3.5 Windows Feature + - .NET Framework 4.5 or later Windows Feature + - Remote Differential Compression Windows Feature + - Windows ADK install + - Windows ADK WinPE install + - Windows MDT install + - Local Administrators + - Add no_sms_on_drive files + + .PARAMETER InstallAdk + Specify whether to install ADK. + + .PARAMETER InstallMDT + Specify wheter to install MDT. + + .PARAMETER AdkSetupExePath + Specifies the path and filename to the ADK Setup. + + .PARAMETER AdkWinPeSetupPath + Specifies the path and filename to the ADK WinPE Setup. + + .PARAMETER MdtMsiPath + Specifies the path and filename to the MDT Setup. + + .PARAMETER InstallWindowsFeatures + Specifiy to install Windows Features needed for the SCCM install. + + .PARAMETER 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. + + .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. + + .PARAMETER NoSmsOnDrives + Specifies the drive letters of the drive you don't want SCCM to install on. + + .PARAMETER DomainCredential + Specifies credentials that have domain read permissions to add domain users or groups to the local + administrators group. + + .PARAMETER AdkProductName + Specifies the Product Name for ADK. + Default: Windows Assessment and Deployment Kit - Windows 10 + + .PARAMETER AdkProductID + Specifies the Product ID for ADK. + Default: fb450356-9879-4b2e-8dc9-282709286661 + + .PARAMETER AdkWinPeProductName + Specifies the Product Name for ADK WinPE. + Default: Windows Assessment and Deployment Kit Windows Preinstallation Environment Add-ons - Windows 10 + + .PARAMETER AdkWinPeProductID + Specifies the Product ID for ADK WinPE. + Default: d8369a05-1f4a-4735-9558-6e131201b1a2 + + .PARAMETER AdkInstallPath + Specifies the path to install ADK and ADK WinPE. + Default: C:\Program Files (x86)\Windows Kits\10 + + .PARAMETER MdtProductName + Specifies the Product Name for MDT. + Default: Microsoft Deployment Toolkit (6.3.8456.1000) + + .PARAMETER MdtProductID + Specifies the Product ID for MDT. + Default: 2E6CD7B9-9D00-4B04-882F-E6971BC9A763 + + .PARAMETER MdtInstallPath + Specifies the path to install MDT. + Default: C:\Program Files\Microsoft Deployment Toolkit + + .NOTES + SCCM Roles based one the following documentation: + https://docs.microsoft.com/en-us/mem/configmgr/core/plan-design/configs/site-and-site-system-prerequisites +#> +Configuration xSCCMPreReqs +{ + [CmdletBinding()] + param + ( + [Parameter()] + [Boolean] + $InstallAdk = $true, + + [Parameter()] + [Boolean] + $InstallMdt, + + [Parameter()] + [System.String] + $AdkSetupExePath, + + [Parameter()] + [System.String] + $AdkWinPeSetupPath, + + [Parameter()] + [System.String] + $MdtMsiPath, + + [Parameter()] + [Boolean] + $InstallWindowsFeatures = $true, + + [Parameter()] + [System.String] + $WindowsFeatureSource = 'C:\Windows\WinSxS', + + [Parameter()] + [ValidateSet('CASorSiteServer','AssetIntelligenceSynchronizationPoint','CertificateRegistrationPoint','DistributionPoint','EndpointProtectionPoint','EnrollmentPoint','EnrollmentProxyPoint','FallbackServicePoint','ManagementPoint','ReportingServicesPoint','ServiceConnectionPoint','StateMigrationPoint','SoftwareUpdatePoint')] + [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','5355'), + + [Parameter()] + [System.String[]] + $LocalAdministrators, + + [Parameter()] + [System.String[]] + $NoSmsOnDrives, + + [Parameter()] + [System.Management.Automation.PSCredential] + $DomainCredential, + + [Parameter()] + [System.String] + $AdkProductName = 'Windows Assessment and Deployment Kit - Windows 10', + + [Parameter()] + [System.String] + $AdkProductID = 'fb450356-9879-4b2e-8dc9-282709286661', + + [Parameter()] + [System.String] + $AdkWinPeProductName = 'Windows Assessment and Deployment Kit Windows Preinstallation Environment Add-ons - Windows 10', + + [Parameter()] + [System.String] + $AdkWinPeProductID = 'd8369a05-1f4a-4735-9558-6e131201b1a2', + + [Parameter()] + [System.String] + $AdkInstallPath ='C:\Program Files (x86)\Windows Kits\10', + + [Parameter()] + [System.String] + $MdtProductName = 'Microsoft Deployment Toolkit (6.3.8456.1000)', + + [Parameter()] + [System.String] + $MdtProductID = '2E6CD7B9-9D00-4B04-882F-E6971BC9A763', + + [Parameter()] + [System.String] + $MdtInstallPath = 'C:\Program Files\Microsoft Deployment Toolkit' + ) + + Import-DscResource -ModuleName PSDesiredStateConfiguration + Import-DscResource -ModuleName NetworkingDsc -ModuleVersion 7.4.0.0 + + $features = @() + foreach ($role in $SccmRole) + { + switch ($role) + { + 'CASorSiteServer' {$features += 'Net-Framework-Core','Net-Framework-45-Core','RDC'} + 'AssetIntelligenceSynchronizationPoint' {$features += 'Net-Framework-45-Core'} + 'CertificateRegistrationPoint' {$features += 'Net-Framework-Core','NET-HTTP-Activation', + 'Net-Framework-45-Core','NET-WCF-HTTP-Activation45','Web-Default-Doc','Web-Asp-Net','Web-Asp-Net45', + 'Web-ISAPI-Ext','Web-ISAPI-Filter','Web-Net-Ext','Web-Net-Ext45','Web-Mgmt-Console','Web-Metabase', + 'Web-WMI','Web-Filtering','WAS-Process-Model','WAS-NET-Environment','WAS-Config-APIs' + } + 'DistributionPoint' {$features += 'RDC','Web-ISAPI-Ext','Web-Windows-Auth','Web-Mgmt-Console', + 'Web-Metabase','Web-WMI','Web-Filtering' + } + 'EndpointProtectionPoint' {'Net-Framework-Core'} + 'EnrollmentPoint' {$features += 'Net-Framework-Core','NET-HTTP-Activation', + 'Net-Framework-45-Core','NET-WCF-HTTP-Activation45','Web-Default-Doc','Web-Asp-Net','Web-Asp-Net45', + 'Web-Net-Ext','Web-Net-Ext45','Web-Mgmt-Console','Web-Metabase' + } + 'EnrollmentProxyPoint' {$features += 'Net-Framework-Core','Net-Framework-45-Core','Web-Default-Doc', + 'Web-Static-Content','Web-Asp-Net','Web-Asp-Net45','Web-ISAPI-Ext','Web-ISAPI-Filter', + 'Web-Net-Ext','Web-Net-Ext45','Web-Filtering','Web-Windows-Auth','Web-Mgmt-Console','Web-Metabase' + } + 'FallbackServicePoint' {$features += 'BITS','BITS-IIS-Ext','RSAT-Bits-Server','Web-ISAPI-Ext', + 'Web-Http-Redirect','Web-Default-Doc','Web-Dir-Browsing','Web-Http-Errors','Web-Static-Content', + 'Web-Http-Logging','Web-Stat-Compression','Web-Filtering','Web-Metabase','Web-Mgmt-Console', + 'Web-Http-Tracing','Web-Log-Libraries','Web-Request-Monitor' + } + 'ManagementPoint' {$features += 'Net-Framework-45-Core','BITS','BITS-IIS-Ext','RSAT-Bits-Server', + 'Web-ISAPI-Ext','Web-Http-Redirect','Web-Default-Doc','Web-Dir-Browsing','Web-Http-Errors', + 'Web-Static-Content','Web-Windows-Auth','Web-Mgmt-Console','Web-Metabase','Web-WMI', + 'Web-Http-Logging','Web-Http-Tracing','Web-Log-Libraries','Web-Request-Monitor','Web-Stat-Compression' + } + 'ReportingServicesPoint' {$features += 'Net-Framework-45-Core'} + 'ServiceConnectionPoint' {$features += 'Net-Framework-45-Core','Net-Framework-Core'} + 'SoftwareUpdatePoint' {$features += 'Net-Framework-45-Core','Net-Framework-Core','UpdateServices', + 'NET-Framework-45-ASPNET','UpdateServices-RSAT','UpdateServices-API','UpdateServices-UI', + 'Web-Asp-Net45','Web-ISAPI-Ext','Web-ISAPI-Filter','Web-Net-Ext45','Web-Default-Doc', + 'Web-Static-Content','Web-Dyn-Compression','Web-Filtering','Web-Windows-Auth','Web-Mgmt-Console', + 'Web-Metabase','UpdateServices-Services','UpdateServices-DB','WAS-Config-APIs' + } + 'StateMigrationPoint' {$features += 'Net-Framework-45-Core','Net-Framework-Core','NET-HTTP-Activation', + 'NET-WCF-HTTP-Activation45','NET-Framework-45-ASPNET','Web-Default-Doc','Web-Asp-Net','Web-Asp-Net45', + 'Web-ISAPI-Ext','Web-ISAPI-Filter','Web-Net-Ext','Web-Net-Ext45','Web-Filtering','Web-Metabase', + 'Web-Mgmt-Console','WAS-NET-Environment','WAS-Config-APIs','WAS-Process-Model' + } + } + } + + if ($InstallWindowsFeatures) + { + [string]$uniqueFeatures = $features | Select-Object -Unique + + WindowsFeatureSet $([string]$SccmRole) + { + Name = $uniqueFeatures + Ensure = 'Present' + Source = $WindowsFeatureSource + } + } + + 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) + { + if ($null -eq $DomainCredential) + { + Write-Error -Message 'When adding domain users/groups to the Local Administrator group, domain credentials are needed.' + } + + Group LocalAdministrators + { + GroupName = 'Administrators' + MembersToInclude = $LocalAdministrators + Credential = $DomainCredential + } + } + elseif ($LocalAdministrators) + { + Group LocalAdministrators + { + GroupName = 'Administrators' + MembersToInclude = $LocalAdministrators + } + } + + if ($InstallAdk) + { + if ([string]::IsNullOrEmpty($AdkSetupExePath) -or [string]::IsNullOrEmpty($AdkWinPeSetupPath)) + { + throw 'To install ADK you must specify ADKSetupExePath and $AdkWinPeSetupPath' + } + + Package ADK + { + Ensure = 'Present' + Path = $AdkSetupExePath + Name = $AdkProductName + ProductId = $AdkProductID + Arguments = "/installpath `"$($AdkInstallPath)`" /features OptionId.DeploymentTools OptionId.UserStateMigrationTool /quiet /norestart /ceip off" + } + + Package WinPE + { + Ensure = 'Present' + Path = $AdkWinPeSetupPath + Name = $AdkWinPeProductName + ProductId = $AdkWinPeProductID + Arguments = "/installpath `"$($AdkInstallPath)`" /quiet /norestart /ceip off" + } + } + + if ($InstallMdt) + { + if ([string]::IsNullOrEmpty($MdtMsiPath)) + { + throw 'To install MDT you must specify MdtMsiPath.' + } + + Package MDT + { + Ensure = 'Present' + Path = $MdtMsiPath + Name = $MdtProductName + ProductId = $MdtProductID + Arguments = "INSTALLDIR=`"$($MdtInstallPath)`" /qn /norestart" + } + } + + foreach ($drive in $NoSmsOnDrives) + { + if ($drive -gt 1) + { + $driveLetter = $drive[0] + } + File "$driveLetter-NoSmsOnDrive" + { + DestinationPath = "$($driveLetter):\no_sms_on_drive.sms" + Ensure = 'Present' + Contents = '' + Type = 'File' + } + } +} diff --git a/source/DSCResources/xSccmSqlSetup/xSccmSqlSetup.psd1 b/source/DSCResources/xSccmSqlSetup/xSccmSqlSetup.psd1 new file mode 100644 index 0000000..573be71 --- /dev/null +++ b/source/DSCResources/xSccmSqlSetup/xSccmSqlSetup.psd1 @@ -0,0 +1,113 @@ +@{ + + # 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 new file mode 100644 index 0000000..1293b4c --- /dev/null +++ b/source/DSCResources/xSccmSqlSetup/xSccmSqlSetup.schema.psm1 @@ -0,0 +1,315 @@ +<# + .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 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] + $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 14.0.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 + 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 + } + + SqlServerNetwork EnableTcpIp + { + InstanceName = $SqlInstanceName + ProtocolName = 'Tcp' + IsEnabled = $true + TcpPort = $SqlPort + RestartService = $true + 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 = '[SqlServerNetwork]EnableTcpIp' + } + } +} diff --git a/source/Examples/Resources/CMIniFile/CMIniFile_CAS.ps1 b/source/Examples/Resources/CMIniFile/CMIniFile_CAS.ps1 index 237c11b..2a2126f 100644 --- a/source/Examples/Resources/CMIniFile/CMIniFile_CAS.ps1 +++ b/source/Examples/Resources/CMIniFile/CMIniFile_CAS.ps1 @@ -10,28 +10,28 @@ Configuration Example { CMIniFile ExampleSetting { - IniFileName = 'Lab-CAS-Test.ini' - IniFilePath = 'C:\windows\temp\' - Action = 'InstallCAS' - CDLatest = $true - ProductID = 'Eval' - SiteCode = 'LAB' - SiteName = 'Contoso - Central Administration Site' - SMSInstallDir = 'C:\Program Files\Microsoft Configuration Manager' - SDKServer = 'CAS.contoso.com' - PreRequisiteComp = $true - PreRequisitePath = 'C:\Windows\Temp\SCCMSetupFiles\Downloads' - AdminConsole = $true - JoinCeip = $false - MobileDeviceLanguage = $false - SQLServerName = 'CAS.contoso.com' - DatabaseName = 'CASINST01\CM_LAB' - SQLSSBPort = 4022 - SQLDataFilePath = 'E:\MSSQL12.CASINST01\MSSQL\Data\App\' - SQLLogFilePath = 'E:\MSSQL12.CASINST01\MSSQL\Log\App\' - CloudConnector = $false - SAActive = $true - CurrentBranch = $true + IniFileName = 'Lab-CAS-Test.ini' + IniFilePath = 'C:\windows\temp\' + Action = 'InstallCAS' + CDLatest = $true + ProductID = 'Eval' + SiteCode = 'LAB' + SiteName = 'Contoso - Central Administration Site' + SMSInstallDir = 'C:\Program Files\Microsoft Configuration Manager' + SDKServer = 'CAS.contoso.com' + PreRequisiteComp = $true + PreRequisitePath = 'C:\Windows\Temp\SCCMSetupFiles\Downloads' + AdminConsole = $true + JoinCeip = $false + MobileDeviceLanguage = $false + SQLServerName = 'CAS.contoso.com' + DatabaseName = 'CASINST01\CM_LAB' + SQLSSBPort = 4022 + SQLDataFilePath = 'C:\MSSQL12.CASINST01\MSSQL\Data\App\' + SQLLogFilePath = 'C:\MSSQL12.CASINST01\MSSQL\Log\App\' + CloudConnector = $false + SAActive = $true + CurrentBranch = $true } } } diff --git a/source/Examples/Resources/CMIniFile/CMIniFile_Primary.ps1 b/source/Examples/Resources/CMIniFile/CMIniFile_Primary.ps1 index b4dbed3..af438a0 100644 --- a/source/Examples/Resources/CMIniFile/CMIniFile_Primary.ps1 +++ b/source/Examples/Resources/CMIniFile/CMIniFile_Primary.ps1 @@ -33,9 +33,9 @@ Configuration Example SQLServerName = 'PRI.contoso.com' DatabaseName = 'PRIINST01\CM_PRI' SQLSSBPort = 4022 - SQLDataFilePath = 'E:\MSSQL12.CASINST01\MSSQL\Data\App\' - SQLLogFilePath = 'E:\MSSQL12.CASINST01\MSSQL\Log\App\' - CloudConnector = $false + SQLDataFilePath = 'C:\MSSQL12.CASINST01\MSSQL\Data\App\' + SQLLogFilePath = 'C:\MSSQL12.CASINST01\MSSQL\Log\App\' + CloudConnector = $true SAActive = $true CurrentBranch = $true } diff --git a/source/Examples/Resources/xSccmInstall/SccmInstall.ps1 b/source/Examples/Resources/xSccmInstall/SccmInstall.ps1 new file mode 100644 index 0000000..a468dbf --- /dev/null +++ b/source/Examples/Resources/xSccmInstall/SccmInstall.ps1 @@ -0,0 +1,29 @@ +#Requires -Module ConfigMgrCBDsc + +<# + .DESCRIPTION + This configuration Install Microsoft System Center Configuration Manager. +#> +Configuration Example +{ + [CmdletBinding()] + param + ( + [Parameter()] + [System.Management.Automation.PSCredential] + $SccmInstallAccount + ) + + Import-DscResource -ModuleName ConfigMgrCBDsc + + Node localhost + { + xSccmInstall SccmInstall + { + SetupExePath = 'C:\Temp\SCCMInstall\SMSSETUP\BIN\X64' + IniFile = 'C:\temp\Lab-CAS-Test.ini' + SccmServerType = 'CAS' + SccmInstallAccount = $SccmInstallAccount + } + } +} diff --git a/source/Examples/Resources/xSccmPreReqs/SccmPreReqs.ps1 b/source/Examples/Resources/xSccmPreReqs/SccmPreReqs.ps1 new file mode 100644 index 0000000..4177fe4 --- /dev/null +++ b/source/Examples/Resources/xSccmPreReqs/SccmPreReqs.ps1 @@ -0,0 +1,38 @@ +#Requires -Module ConfigMgrCBDsc + +<# + .DESCRIPTION + This configuration will install: ADK, ADK WinPE and MDT, add users/groups to the Local Administrators group, + and put nosms files on specified drives. +#> +Configuration Example +{ + [CmdletBinding()] + param + ( + [Parameter()] + [System.Management.Automation.PSCredential] + $DomainCredential + ) + + Import-DscResource -ModuleName ConfigMgrCBDsc + + Node localhost + { + xSccmPreReqs SCCMPreReqs + { + InstallAdk = $true + 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' + LocalAdministrators = @('contoso\administrator','contoso\AdminGroup','contoso\svc.installaccount') + NoSmsOnDrives = 'd' + DomainCredential = $DomainCredential + } + } +} diff --git a/source/Examples/Resources/xSccmSqlSetup/SccmSqlSetup.ps1 b/source/Examples/Resources/xSccmSqlSetup/SccmSqlSetup.ps1 new file mode 100644 index 0000000..b8ae580 --- /dev/null +++ b/source/Examples/Resources/xSccmSqlSetup/SccmSqlSetup.ps1 @@ -0,0 +1,36 @@ +#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 new file mode 100644 index 0000000..464d533 --- /dev/null +++ b/source/Examples/Resources/xSccmSqlSetup/SccmSqlSetupAndManagementStudio.ps1 @@ -0,0 +1,38 @@ +#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' + } + } +}