Skip to content

Commit

Permalink
Composite Resources: xSccmPreReqs, xSccmSqlinstall, xSccmInstall (#6)
Browse files Browse the repository at this point in the history
* Initial resource

* Update MOF

* fixed typo

* Fixed logic and update params

* Added logic to check for parameters that don't work with CAS

* Updated examples and fixed parameter

* Fixed formatting

* Added missing parameters

* Fixed spacing and param

* Added tests and fixed logic issues.

* Fixed mof to required.

* Updated tests

* change hashtbale format

* Updated synposis in the examples.

* Added test for optional PRI params

* Added comments and additonal test.

* Removed results from Test

* Missing space.

* Updated with PR comments

* Changed to Localized data

* Updated Readme

* Updated Verbose strings.

* Updated Readme

* Removed Formatting of string

* Fixed line length

* Added missing localized data

* Removed duplicate functions.

* Updated other modules with new localiazed data

* Updated Readme

* Removed tests from helper tests

* Updated string formatting

* Trying MOF file

* Added prereqs and Sql Install

* Added SQL module

* Add sql Module Verison

* Added parameter

* Updated psd1

* Fixed SccmSql Issues

* updated configs

* Added logic for null local admins

* Added Management Studio option

* Added examples

* Fixed examples and format

* Fixed failed build issues

* Change config names

* fixed duplicate key

* Updated examples and psd1

* Updated readmed and command help

* Update command line help

* Fix ini example in readme

* Bug in ini file

* Updated SQL parameters and defaults

* Updated Readme

* Added back Module Version

* Fixed readme and examples

* Added install windows feature option

* Added Firewall option

* Added SCCM Role param

* Add pre reqs for features.

* Added required modules

* Added Module versions

* Removed module

* Added back

* Updated fixes needed.

* PR comments

* fixed sapacing.

* Add Features and default value

* Added source Option for Windows Features.

* Updated command line help with parameter

* Added firewall rule

* fixed typo in sql

* Fixed HQRM failures

* fixed domain account bug

* Removed hardcoded versions

* Added back module versions

* typecast feature string

* typecast name

* added default sxs path

* Modified drive letter to only be a letter

* Fixed PR comments

Co-authored-by: Ryan Christman <[email protected]>
  • Loading branch information
rchristman89 and Ryan Christman authored Jun 17, 2020
1 parent 7b748e1 commit 5ed121f
Show file tree
Hide file tree
Showing 16 changed files with 1,422 additions and 30 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
153 changes: 152 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: '<InstallSQLDataDir>\<SQLInstanceID>\MSSQL\Data'
- **[String] SqlUserDBLogDir** : Specifies the directory for the log
files for user databases.
Default Value: '<InstallSQLDataDir>\<SQLInstanceID>\MSSQL\Data'
- **[String] SqlTempDBDir** : Specifies the directory for the data
files for tempdb.
Default Value: '<InstallSQLDataDir>\<SQLInstanceID>\MSSQL\Data'
- **[String] SqlTempDBLogDir** : Specifies the directory for the log
files for tempdb.
Default Value: '<InstallSQLDataDir>\<SQLInstanceID>\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
Expand Down
3 changes: 2 additions & 1 deletion RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@

# Build dependent modules
'DscResource.Common' = 'latest'
'SqlServerDsc' = '14.0.0'
'NetworkingDsc' = '7.4.0.0'
}

11 changes: 8 additions & 3 deletions source/ConfigMgrCBDsc.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
# DSC resources to export from this module
DscResourcesToExport = @(
'CMAccounts'
'SccmIniFile'
'XSccmInstall'
'xSccmPreReqs'
'xSccmSqlSetup'
'CMIniFile'
'CMCollections'
'CMBoundaries'
Expand All @@ -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'
Expand Down
113 changes: 113 additions & 0 deletions source/DSCResources/xSccmInstall/xSccmInstall.psd1
Original file line number Diff line number Diff line change
@@ -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 = ''
}
61 changes: 61 additions & 0 deletions source/DSCResources/xSccmInstall/xSccmInstall.schema.psm1
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading

0 comments on commit 5ed121f

Please sign in to comment.