From bee6a91ed1b160178cc045873af37b934089e7ff Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Fri, 30 Oct 2020 15:33:31 -0400 Subject: [PATCH 01/17] Initial Push --- source/Examples/PrimaryInstall.ps1 | 580 +++++++++++++++++++++++++++++ 1 file changed, 580 insertions(+) create mode 100644 source/Examples/PrimaryInstall.ps1 diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 new file mode 100644 index 0000000..5f83537 --- /dev/null +++ b/source/Examples/PrimaryInstall.ps1 @@ -0,0 +1,580 @@ +#Requires -Module ConfigMgrCBDsc + +<# + .DESCRIPTION + This configuration will install the prerequistes that are need for SCCM, install SQL, create the ini file + needed for the SCCM install, and install SCCM. + + .NOTES + Ensure the SCCM install is not on a drive that is specified for xSccmPreReqs NoSmsOnDrives. + Ensure the SQLInstall SqlPort is not the same as SQLSSBPort in the SCCM ini file. + + This file has been updated to remove identifying information, search replace contoso with the correct domain identifier. +#> +Configuration PrimaryInstall +{ + [CmdletBinding()] + param + ( + [Parameter()] + [System.String] + $ServerName, + + [Parameter()] + [System.String] + $SiteName, + + [Parameter()] + [System.String] + $SiteCode, + + [Parameter()] + [System.Management.Automation.PSCredential] + $DomainCredential, + + [Parameter()] + [System.Management.Automation.PSCredential] + $SqlServiceCredential, + + [Parameter()] + [System.Management.Automation.PSCredential] + $SqlAgentServiceCredential, + + [Parameter()] + [System.Management.Automation.PSCredential] + $SccmInstallAccount, + + [Parameter()] + [System.Management.Automation.PSCredential[]] + $CMAccounts, + + [Parameter()] + [System.Nullable[UInt32]] + $ConfigMgrVersion + ) + + Import-DscResource -ModuleName PSDesiredStateConfiguration + Import-DscResource -ModuleName xPSDesiredStateConfiguration -ModuleVersion 9.1.0 + Import-DSCResource -ModuleName ComputerManagementDsc -ModuleVersion 8.2.0 + Import-DscResource -ModuleName ConfigMgrCBDsc -ModuleVersion 0.2.0 + Import-DscResource -ModuleName StorageDsc -ModuleVersion 5.0.0 + Import-DscResource -ModuleName SqlServerDsc -ModuleVersion 14.0.0 + Import-DscResource -ModuleName UpdateServicesDsc -ModuleVersion 1.2.1 + Import-DscResource -ModuleName NetworkingDsc -ModuleVersion 7.4.0.0 + + Node localhost + { + LocalConfigurationManager + { + RebootNodeIfNeeded = $true + } + + $serverShortName = $ServerName.split('.')[0] + + if ($serverShortName.Length -gt 4) + { + $dbInstanceName = $serverShortName.SubString($serverShortName.Length - 4) + "DB01" + } + else + { + $dbInstanceName = $serverShortName + "DB01" + } + + if ($ConfigMgrVersion -lt '1910') + { + $adkProductID = 'fb450356-9879-4b2e-8dc9-282709286661' + $winPeProductID = 'd8369a05-1f4a-4735-9558-6e131201b1a2' + } + else + { + $adkProductID = '9346016b-6620-4841-8ea4-ad91d3ea02b5' + $winPeProductID = '353df250-4ecc-4656-a950-4df93078a5fd' + } + + #SCCM PreReqs + xSccmPreReqs SCCMPreReqs + { + InstallAdk = $true + InstallMdt = $true + AdkSetupExePath = 'C:\Temp\adksetup.exe' + AdkWinPeSetupPath = 'C:\Temp\adkwinpesetup.exe' + MdtMsiPath = 'C:\Temp\MicrosoftDeploymentToolkit_x64_1809.msi' + 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') + NoSmsOnDrives = 'c' + DomainCredential = $DomainCredential + AdkInstallPath = 'C:\Apps\ADK' + MdtInstallPath = 'C:\Apps\MDT' + AdkProductName = 'Windows Assessment and Deployment Kit - Windows 10' + AdkProductID = $adkProductID + AdkWinPeProductName = 'Windows Assessment and Deployment Kit Windows Preinstallation Environment Add-ons - Windows 10' + 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' + } + + #Install WSUS features + WindowsFeatureSet WSUSFeatures + { + Name = 'UpdateServices-Services','UpdateServices-DB','UpdateServices-API','UpdateServices-UI' + Ensure = 'Present' + Source = 'C:\Windows\WinSxS' + } + + # WSUS registry value to fix issues with WSUS self-signed certificates + Registry EnableWSUSSelfSignedCert + { + Ensure = 'Present' + Key = 'HKLM:\Software\Microsoft\Update Services\Server\Setup' + ValueName = 'EnableSelfSignedCertificates' + ValueData = '1' + ValueType = 'Dword' + } + + File WSUSUpdates + { + DestinationPath = 'C:\Apps\WSUS' + Ensure = 'Present' + Type = 'Directory' + } + + UpdateServicesServer WSUSConfig + { + Ensure = 'Present' + SQLServer = "$ServerName\$dbInstanceName" + ContentDir = 'C:\Apps\WSUS' + UpstreamServerSSL = $false + Synchronize = $false + DependsOn = '[File]WSUSUpdates','[WindowsFeatureSet]WSUSFeatures','[Registry]EnableWSUSSelfSignedCert' + } + + File CreateIniFolder + { + Ensure = 'Present' + Type = 'Directory' + DestinationPath = 'C:\SetupFiles' + DependsOn = '[xSccmSqlSetup]SCCMSqlInstall' + } + + CMIniFile CreateSCCMIniFile + { + IniFileName = 'Demo.ini' + IniFilePath = 'C:\SetupFiles\' + Action = 'InstallPrimarySite' + CDLatest = $false + ProductID = 'eval' + SiteCode = $SiteCode + SiteName = "$SiteName - Primary Site" + SMSInstallDir = 'C:\Apps\Microsoft Configuration Manager' + SDKServer = $ServerName + RoleCommunicationProtocol = 'HTTPorHTTPS' + ClientsUsePKICertificate = $true + PreRequisiteComp = $true + PreRequisitePath = 'C:\temp\SCCMInstall\Downloads' + AdminConsole = $true + JoinCeip = $false + MobileDeviceLanguage = $false + SQLServerName = $ServerName + DatabaseName = "$dbInstanceName\CM_$SiteCode" + SQLSSBPort = 4022 + SQLDataFilePath = "C:\MSSQL12.$dbInstanceName\MSSQL\Data\" + SQLLogFilePath = "C:\MSSQL12.$dbInstanceName\MSSQL\Log\" + CloudConnector = $false + SAActive = $true + CurrentBranch = $true + DependsOn = '[File]CreateIniFolder' + } + + PendingReboot PreInstall + { + Name = 'PreInstall' + DependsOn = '[UpdateServicesServer]WSUSConfig' + } + + xSccmInstall SccmInstall + { + SetupExePath = 'C:\temp\SCCMInstall\SMSSETUP\BIN\X64' + IniFile = 'C:\SetupFiles\Demo.ini' + SccmServerType = 'Primary' + SccmInstallAccount = $SccmInstallAccount + Version = $ConfigMgrVersion + DependsOn = '[PendingReboot]PreInstall','[CMIniFile]CreateSCCMIniFile' + } + + # Ensuring the machine reboots after SCCM install in order to be sure configurations proceed properly + Script RebootAfterSccmSetup + { + TestScript = { + return (Test-Path HKLM:\SOFTWARE\Microsoft\SMS\RebootAfterSCCMSetup) + } + SetScript = { + $process = Get-Process | Where-Object -FilterScript {$_.Description -eq 'Configuration Manager Setup BootStrapper'} + + if ([string]::IsNullOrEmpty($process)) + { + Write-Verbose -Message "SCCM has finished installing setting reboot" + New-Item -Path HKLM:\SOFTWARE\Microsoft\SMS\RebootAfterSCCMSetup -Force + $global:DSCMachineStatus = 1 + } + else + { + throw 'Configuration Manager setup is still running' + } + } + GetScript = { return @{result = 'result'}} + DependsOn = '[xSccmInstall]SccmInstall' + } + + #region ConfigCBMgr configurations + foreach ($account in $CMAccounts) + { + CMAccounts "AddingAccount-$($account.Username)" + { + SiteCode = $SiteCode + Account = $account.Username + AccountPassword = $account + Ensure = 'Present' + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + [array]$cmAccountsDependsOn += "[CMAccounts]AddingAccount-$($account.Username)" + } + + CMForestDiscovery CreateForestDiscovery + { + SiteCode = $SiteCode + Enabled = $false + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + CMSystemDiscovery CreateSystemDiscovery + { + SiteCode = $SiteCode + Enabled = $true + ScheduleInterval = 'Days' + ScheduleCount = 7 + EnableDeltaDiscovery = $true + DeltaDiscoveryMins = 60 + EnableFilteringExpiredLogon = $true + TimeSinceLastLogonDays = 90 + EnableFilteringExpiredPassword = $true + TimeSinceLastPasswordUpdateDays = 90 + ADContainers = @('LDAP://OU=Domain Controllers,DC=contoso,DC=com','LDAP://CN=Computers,DC=contoso,DC=com') + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + CMNetworkDiscovery DisableNetworkDiscovery + { + SiteCode = $SiteCode + Enabled = $false + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + CMHeartbeatDiscovery CreateHeartbeatDiscovery + { + SiteCode = $SiteCode + Enabled = $true + ScheduleInterval = 'Days' + ScheduleCount = '1' + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + CMUserDiscovery CreateUserDiscovery + { + SiteCode = $SiteCode + Enabled = $true + ScheduleInterval = 'Days' + ScheduleCount = 7 + EnableDeltaDiscovery = $true + DeltaDiscoveryMins = 5 + ADContainers = @('LDAP://CN=Users,DC=contoso,DC=com') + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + CMClientStatusSettings CreateClientStatusSettings + { + SiteCode = $SiteCode + IsSingleInstance = 'Yes' + ClientPolicyDays = 7 + HeartbeatDiscoveryDays = 7 + SoftwareInventoryDays = 7 + HardwareInventoryDays = 7 + StatusMessageDays = 7 + HistoryCleanupDays = 31 + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + File CreateBackupFolder + { + Ensure = 'Present' + Type = 'Directory' + DestinationPath = 'C:\cmsitebackups' + } + + CMSiteMaintenance Backup + { + SiteCode = $SiteCode + TaskName = 'Backup SMS Site Server' + Enabled = $true + DaysOfWeek = @('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday') + BeginTime = '1500' + LatestBeginTime = '2000' + BackupLocation = 'C:\cmsitebackups' + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup','[File]CreateBackupFolder' + } + + [array]$cmSiteMaintenanceDependsOn += '[CMSiteMaintenance]Backup' + + CMSiteMaintenance DeleteEP + { + SiteCode = $SiteCode + TaskName = 'Delete Aged EP Health Status History Data' + Enabled = $false + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + [array]$cmSiteMaintenanceDependsOn += '[CMSiteMaintenance]DeleteEP' + + CMSiteMaintenance UpdateAppTables + { + SiteCode = $SiteCode + TaskName = 'Update Application Catalog Tables' + Enabled = $true + RunInterval = 1380 + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + [array]$cmSiteMaintenanceDependsOn += '[CMSiteMaintenance]UpdateAppTables' + + CMSiteMaintenance InactiveDisco + { + SiteCode = $SiteCode + TaskName = 'Delete Inactive Client Discovery Data' + Enabled = $true + DaysOfWeek = 'Saturday' + DeleteOlderThanDays = 90 + BeginTime = '1500' + LatestBeginTime = '2000' + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + [array]$cmSiteMaintenanceDependsOn += '[CMSiteMaintenance]InactiveDisco' + + CMBoundaries DemoBoundary + { + SiteCode = $SiteCode + DisplayName = 'Contoso Boundary' + Value = '10.10.1.1-10.10.1.254' + Type = 'IPRange' + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + CMBoundaryGroups DemoBoundaryGroup + { + SiteCode = $SiteCode + BoundaryGroup = 'Contoso BoundaryGroup' + Boundaries = @( + DSC_CMBoundaryGroupsBoundaries + { + Value = '10.10.1.1-10.10.1.254' + Type = 'IPRange' + } + ) + SiteSystemsToInclude = @($ServerName) + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[CMBoundaries]DemoBoundary' + } + + CMAdministrativeUser SiteAdmins + { + SiteCode = $SiteCode + AdminName = 'Contoso\SCCM-SiteAdmins' + RolesToInclude = 'Full Administrator' + ScopesToInclude = 'All' + Ensure = 'Present' + DependsOn = '[Script]RebootAfterSccmSetup' + } + + + CMCollectionMembershipEvaluationComponent CollectionSettings + { + SiteCode = $SiteCode + EvaluationMins = 5 + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + CMStatusReportingComponent StatusReportingSettings + { + SiteCode = $SiteCode + ClientLogChecked = $false + ClientLogFailureChecked = $false + ClientReportChecked = $true + ClientReportFailureChecked = $true + ClientReportType = 'AllMilestones' + ServerLogChecked = $false + ServerLogFailureChecked = $false + ServerReportChecked = $true + ServerReportFailureChecked = $true + ServerReportType = 'AllMilestones' + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + Registry MaxHWMifSize + { + Ensure = 'Present' + Key = 'HKLM:\Software\Microsoft\SMS\Components\SMS_Inventory_Data_Loader' + ValueName = 'Max MIF Size' + ValueData = 500000000 + ValueType = 'Dword' + DependsOn = '[Script]RebootAfterSccmSetup' + } + + CMDistributionGroup DistroPtGroup + { + SiteCode = $SiteCode + DistributionGroup = "$SiteCode - All Distribution Points" + Ensure = 'Present' + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + CMDistributionPoint DPRole + { + SiteCode = $SiteCode + SiteServerName = $ServerName + Description = 'Standard Distribution Point' + MinimumFreeSpaceMB = 100 + BoundaryGroups = @('Contoso BoundaryGroup') + BoundaryGroupStatus = 'Add' + AllowPrestaging = $false + EnableAnonymous = $true + EnableBranchCache = $true + EnableLedbat = $true + ClientCommunicationType = 'Http' + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[CMDistributionGroup]DistroPtGroup' + } + + CMDistributionPointGroupMembers DPGroupMembers + { + SiteCode = $SiteCode + DistributionPoint = $ServerName + DistributionGroupsToInclude = @("$SiteCode - All Distribution Points") + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = "[CMDistributionPoint]DPRole" + } + + CMManagementPoint MPInstall + { + SiteCode = $SiteCode + SiteServerName = $ServerName + Ensure = 'Present' + GenerateAlert = $true + UseSiteDatabase = $true + UseComputerAccount = $true + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + CMSoftwareUpdatePoint SUPInstall + { + SiteCode = $SiteCode + SiteServerName = $ServerName + ClientConnectionType = 'Intranet' + EnableCloudGateway = $false + UseProxy = $false + UseProxyForAutoDeploymentRule = $false + WsusIisPort = '8530' + WsusIisSslPort = '8531' + WsusSsl = $false + PsDscRunAsCredential = $SccmInstallAccount + DependsOn = '[Script]RebootAfterSccmSetup' + } + + Script RebootAfterSCCMConfigurationInstall + { + TestScript = { + return (Test-Path HKLM:\SOFTWARE\Microsoft\SMS\RebbotAfterConfiguration) + } + SetScript = { + New-Item -Path HKLM:\SOFTWARE\Microsoft\SMS\RebbotAfterConfiguration -Force + $global:DSCMachineStatus = 1 + } + GetScript = { return @{result = 'result'}} + DependsOn = $cmAccountsDependsOn,'[CMForestDiscovery]CreateForestDiscovery','[CMSystemDiscovery]CreateSystemDiscovery','[CMNetworkDiscovery]DisableNetworkDiscovery', + '[CMHeartbeatDiscovery]CreateHeartbeatDiscovery','[CMUserDiscovery]CreateUserDiscovery','[CMClientStatusSettings]CreateClientStatusSettings',$cmSiteMaintenanceDependsOn, + '[CMBoundaryGroups]DemoBoundaryGroup','[CMAdministrativeUser]SiteAdmins','[CMCollectionMembershipEvaluationComponent]CollectionSettings', + '[CMStatusReportingComponent]StatusReportingSettings','[Registry]MaxHWMifSize','[CMDistributionPointGroupMembers]DPGroupMembers','[CMManagementPoint]MPInstall', + '[CMSoftwareUpdatePoint]SUPInstall' + } + } +} + +$ConfigurationData = @{ + AllNodes = @( + @{ + NodeName = '*' + PSDscAllowDomainUser = $true + PSDscAllowPlainTextPassword = $true + } + ) +} + +$params = @{ + ServerName = 'PR01.contoso.com' + SiteCode = 'PRI' + ConfigMgrVersion = 1902 + SiteName = 'Contoso' + DomainCredential = Get-Credential -Username 'contoso\SCCM-CMInstall' -Message 'SCCM Install account' + SqlServiceCredential = Get-Credential -Username 'contoso\SCCM-SqlSvc' -Message 'SCCM SQL Service account' + SqlAgentServiceCredential = Get-Credential -Username 'contoso\SCCM-SqlAgt' -Message 'SCCM SQL Agent account' + SccmInstallAccount = Get-Credential -Username 'contoso\SCCM-CMInstall' -Message 'SCCM Install account' + CMAccounts = @( + Get-Credential -Username 'contoso\SCCM-Network' -Message 'SCCM Network Service account' + Get-Credential -Username 'contoso\SCCM-ClientPush' -Message 'SCCM Client Push account' + Get-Credential -Username 'contoso\SCCM-ADJoin' -Message 'SCCM AD Join account' + ) +} + +PrimaryInstall -ConfigurationData $ConfigurationData -OutputPath C:\Temp\Primary @params From 0aead723534728ca0258420813de6cb15a118c24 Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Fri, 30 Oct 2020 15:41:21 -0400 Subject: [PATCH 02/17] UpdatingNotes and ConfigData --- source/Examples/PrimaryInstall.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index 5f83537..4133036 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -3,7 +3,8 @@ <# .DESCRIPTION This configuration will install the prerequistes that are need for SCCM, install SQL, create the ini file - needed for the SCCM install, and install SCCM. + needed for the SCCM install, and install SCCM. This will also perform a basic configuration on the Primary + Site Server. .NOTES Ensure the SCCM install is not on a drive that is specified for xSccmPreReqs NoSmsOnDrives. @@ -554,7 +555,7 @@ Configuration PrimaryInstall $ConfigurationData = @{ AllNodes = @( @{ - NodeName = '*' + NodeName = 'Localhost' PSDscAllowDomainUser = $true PSDscAllowPlainTextPassword = $true } From 97e70c446b3c67c6e35eee8240ced67fc43b9c0d Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Tue, 3 Nov 2020 12:50:15 -0500 Subject: [PATCH 03/17] Updating Standalone Primary Example --- source/Examples/PrimaryInstall.ps1 | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index 4133036..b0d88e1 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -7,10 +7,18 @@ Site Server. .NOTES + Having AD set up is a pre-requisite. Please ensure the appropriate accounts are created and nested as desired. + ADK, MDT, SQL, and SCCM source media are required in order to use this example. + Please examine the Import-DscResource statements and ensure that the appropriate modules are installed. + Replace the line items specified with entries appropriate to your environment. Ensure the SCCM install is not on a drive that is specified for xSccmPreReqs NoSmsOnDrives. Ensure the SQLInstall SqlPort is not the same as SQLSSBPort in the SCCM ini file. - This file has been updated to remove identifying information, search replace contoso with the correct domain identifier. + This configuration will generate a mof and a meta mof. Please use the Set-DscLocalConfigurationManager + commandlet to apply the meta mof first. + + Please note: this example provides no methodology to encrypt the mof file and any credentials will be + saved in the mof in plain text. #> Configuration PrimaryInstall { @@ -55,10 +63,8 @@ Configuration PrimaryInstall ) Import-DscResource -ModuleName PSDesiredStateConfiguration - Import-DscResource -ModuleName xPSDesiredStateConfiguration -ModuleVersion 9.1.0 Import-DSCResource -ModuleName ComputerManagementDsc -ModuleVersion 8.2.0 Import-DscResource -ModuleName ConfigMgrCBDsc -ModuleVersion 0.2.0 - Import-DscResource -ModuleName StorageDsc -ModuleVersion 5.0.0 Import-DscResource -ModuleName SqlServerDsc -ModuleVersion 14.0.0 Import-DscResource -ModuleName UpdateServicesDsc -ModuleVersion 1.2.1 Import-DscResource -ModuleName NetworkingDsc -ModuleVersion 7.4.0.0 @@ -106,7 +112,6 @@ Configuration PrimaryInstall AddWindowsFirewallRule = $true FirewallProfile = 'Domain','Private' LocalAdministrators = @('contoso\SCCM-Servers','contoso\SCCM-CMInstall','contoso\Admin') - NoSmsOnDrives = 'c' DomainCredential = $DomainCredential AdkInstallPath = 'C:\Apps\ADK' MdtInstallPath = 'C:\Apps\MDT' @@ -171,6 +176,8 @@ Configuration PrimaryInstall Ensure = 'Present' SQLServer = "$ServerName\$dbInstanceName" ContentDir = 'C:\Apps\WSUS' + Products = '*' + Classifications = '*' UpstreamServerSSL = $false Synchronize = $false DependsOn = '[File]WSUSUpdates','[WindowsFeatureSet]WSUSFeatures','[Registry]EnableWSUSSelfSignedCert' @@ -213,12 +220,6 @@ Configuration PrimaryInstall DependsOn = '[File]CreateIniFolder' } - PendingReboot PreInstall - { - Name = 'PreInstall' - DependsOn = '[UpdateServicesServer]WSUSConfig' - } - xSccmInstall SccmInstall { SetupExePath = 'C:\temp\SCCMInstall\SMSSETUP\BIN\X64' @@ -226,7 +227,7 @@ Configuration PrimaryInstall SccmServerType = 'Primary' SccmInstallAccount = $SccmInstallAccount Version = $ConfigMgrVersion - DependsOn = '[PendingReboot]PreInstall','[CMIniFile]CreateSCCMIniFile' + DependsOn = '[CMIniFile]CreateSCCMIniFile' } # Ensuring the machine reboots after SCCM install in order to be sure configurations proceed properly From f227eaf5991cb6ead8da26a4f21a2c4b2a3d9da6 Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Tue, 3 Nov 2020 12:55:19 -0500 Subject: [PATCH 04/17] Updating Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3ddea7..366d536 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 1910 and greater. - Updated ReadMe with latest versions of ConfigMgr that the module has been tested on. +- Added an example for a Standalone Primary Site Server. ### Removed From 4acb8f3592c9df6b55c1b0d0223d0f573d1a0278 Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Tue, 3 Nov 2020 14:55:23 -0500 Subject: [PATCH 05/17] Removed BOM --- source/Examples/PrimaryInstall.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index b0d88e1..9ed8d38 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -1,4 +1,4 @@ -#Requires -Module ConfigMgrCBDsc +#Requires -Module ConfigMgrCBDsc <# .DESCRIPTION From 260c5e9936af265f69d8183936550e35f1a8bc4e Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Tue, 3 Nov 2020 15:02:20 -0500 Subject: [PATCH 06/17] Updating RequiredModules --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 366d536..4a9560e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,7 +78,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 1910 and greater. - Updated ReadMe with latest versions of ConfigMgr that the module has been tested on. -- Added an example for a Standalone Primary Site Server. +- Added an example for a Standalone Primary Site Server and updated required modules + to support. ### Removed From 81e3de73e99b128f3c7d6dc1f3f69c7f452a1abf Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Tue, 3 Nov 2020 15:02:48 -0500 Subject: [PATCH 07/17] Updating Required Modules --- RequiredModules.psd1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RequiredModules.psd1 b/RequiredModules.psd1 index 3e0a3f0..57a3e2a 100644 --- a/RequiredModules.psd1 +++ b/RequiredModules.psd1 @@ -24,4 +24,6 @@ 'DscResource.Common' = 'latest' 'SqlServerDsc' = '14.0.0' 'NetworkingDsc' = '7.4.0.0' + 'ComputerManagementDsc' = '8.2.0' + 'UpdateServicesDsc ' = '1.2.1' } From 072a3e4875b4f26a5391665edd1ed8ca9c77ec4f Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Tue, 3 Nov 2020 15:09:11 -0500 Subject: [PATCH 08/17] fixing typo in requiredmodules --- RequiredModules.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RequiredModules.psd1 b/RequiredModules.psd1 index 57a3e2a..711859f 100644 --- a/RequiredModules.psd1 +++ b/RequiredModules.psd1 @@ -25,5 +25,5 @@ 'SqlServerDsc' = '14.0.0' 'NetworkingDsc' = '7.4.0.0' 'ComputerManagementDsc' = '8.2.0' - 'UpdateServicesDsc ' = '1.2.1' + 'UpdateServicesDsc' = '1.2.1' } From 4842fd0e229753bdc414b977f4519318734ea85e Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Tue, 3 Nov 2020 16:16:08 -0500 Subject: [PATCH 09/17] Updating Primary Install Example --- source/Examples/PrimaryInstall.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index 9ed8d38..84f66f4 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -11,6 +11,7 @@ ADK, MDT, SQL, and SCCM source media are required in order to use this example. Please examine the Import-DscResource statements and ensure that the appropriate modules are installed. Replace the line items specified with entries appropriate to your environment. + Uncomment the block at the bottom for parameters and define the parameters as desired. Ensure the SCCM install is not on a drive that is specified for xSccmPreReqs NoSmsOnDrives. Ensure the SQLInstall SqlPort is not the same as SQLSSBPort in the SCCM ini file. @@ -552,8 +553,8 @@ Configuration PrimaryInstall } } } - -$ConfigurationData = @{ +<# +$configurationData = @{ AllNodes = @( @{ NodeName = 'Localhost' @@ -579,4 +580,4 @@ $params = @{ ) } -PrimaryInstall -ConfigurationData $ConfigurationData -OutputPath C:\Temp\Primary @params +PrimaryInstall -ConfigurationData $configurationData -OutputPath C:\Temp\Primary @params#> From 342972abaa75fc3f2e3a93481ec7978bc83dd9a9 Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Wed, 4 Nov 2020 07:19:26 -0500 Subject: [PATCH 10/17] Resolving PR Comments --- source/Examples/PrimaryInstall.ps1 | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index 84f66f4..889a3b1 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -77,7 +77,7 @@ Configuration PrimaryInstall RebootNodeIfNeeded = $true } - $serverShortName = $ServerName.split('.')[0] + $serverShortName = $ServerName.Split('.')[0] if ($serverShortName.Length -gt 4) { @@ -147,14 +147,6 @@ Configuration PrimaryInstall DependsOn = '[xSccmPreReqs]SCCMPreReqs' } - #Install WSUS features - WindowsFeatureSet WSUSFeatures - { - Name = 'UpdateServices-Services','UpdateServices-DB','UpdateServices-API','UpdateServices-UI' - Ensure = 'Present' - Source = 'C:\Windows\WinSxS' - } - # WSUS registry value to fix issues with WSUS self-signed certificates Registry EnableWSUSSelfSignedCert { @@ -181,7 +173,7 @@ Configuration PrimaryInstall Classifications = '*' UpstreamServerSSL = $false Synchronize = $false - DependsOn = '[File]WSUSUpdates','[WindowsFeatureSet]WSUSFeatures','[Registry]EnableWSUSSelfSignedCert' + DependsOn = '[File]WSUSUpdates','[xSccmPreReqs]SCCMPreReqs','[Registry]EnableWSUSSelfSignedCert' } File CreateIniFolder @@ -227,7 +219,7 @@ Configuration PrimaryInstall IniFile = 'C:\SetupFiles\Demo.ini' SccmServerType = 'Primary' SccmInstallAccount = $SccmInstallAccount - Version = $ConfigMgrVersion + Version = 2006 DependsOn = '[CMIniFile]CreateSCCMIniFile' } @@ -567,7 +559,6 @@ $configurationData = @{ $params = @{ ServerName = 'PR01.contoso.com' SiteCode = 'PRI' - ConfigMgrVersion = 1902 SiteName = 'Contoso' DomainCredential = Get-Credential -Username 'contoso\SCCM-CMInstall' -Message 'SCCM Install account' SqlServiceCredential = Get-Credential -Username 'contoso\SCCM-SqlSvc' -Message 'SCCM SQL Service account' From f61dd7ab1da6fcf065bfc2f662edcde2a58eefd5 Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Wed, 4 Nov 2020 07:36:05 -0500 Subject: [PATCH 11/17] Uncommenting some parameters --- source/Examples/PrimaryInstall.ps1 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index 889a3b1..c0ffbe5 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -11,7 +11,7 @@ ADK, MDT, SQL, and SCCM source media are required in order to use this example. Please examine the Import-DscResource statements and ensure that the appropriate modules are installed. Replace the line items specified with entries appropriate to your environment. - Uncomment the block at the bottom for parameters and define the parameters as desired. + Uncomment the blocks at the bottom for configuration data and parameters and define the parameters as desired. Ensure the SCCM install is not on a drive that is specified for xSccmPreReqs NoSmsOnDrives. Ensure the SQLInstall SqlPort is not the same as SQLSSBPort in the SCCM ini file. @@ -219,7 +219,7 @@ Configuration PrimaryInstall IniFile = 'C:\SetupFiles\Demo.ini' SccmServerType = 'Primary' SccmInstallAccount = $SccmInstallAccount - Version = 2006 + Version = $ConfigMgrVersion DependsOn = '[CMIniFile]CreateSCCMIniFile' } @@ -554,13 +554,14 @@ $configurationData = @{ PSDscAllowPlainTextPassword = $true } ) -} +}#> $params = @{ ServerName = 'PR01.contoso.com' SiteCode = 'PRI' SiteName = 'Contoso' - DomainCredential = Get-Credential -Username 'contoso\SCCM-CMInstall' -Message 'SCCM Install account' + ConfigMgrVersion = 2006 + <#DomainCredential = Get-Credential -Username 'contoso\SCCM-CMInstall' -Message 'SCCM Install account' SqlServiceCredential = Get-Credential -Username 'contoso\SCCM-SqlSvc' -Message 'SCCM SQL Service account' SqlAgentServiceCredential = Get-Credential -Username 'contoso\SCCM-SqlAgt' -Message 'SCCM SQL Agent account' SccmInstallAccount = Get-Credential -Username 'contoso\SCCM-CMInstall' -Message 'SCCM Install account' @@ -568,7 +569,7 @@ $params = @{ Get-Credential -Username 'contoso\SCCM-Network' -Message 'SCCM Network Service account' Get-Credential -Username 'contoso\SCCM-ClientPush' -Message 'SCCM Client Push account' Get-Credential -Username 'contoso\SCCM-ADJoin' -Message 'SCCM AD Join account' - ) + )#> } -PrimaryInstall -ConfigurationData $configurationData -OutputPath C:\Temp\Primary @params#> +#PrimaryInstall -ConfigurationData $configurationData -OutputPath C:\Temp\Primary @params From 77057818a5095471b42d5735ba47349244b7298d Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Wed, 4 Nov 2020 08:02:54 -0500 Subject: [PATCH 12/17] Modifying example for use of parameters --- source/Examples/PrimaryInstall.ps1 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index c0ffbe5..681b84d 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -77,6 +77,12 @@ Configuration PrimaryInstall RebootNodeIfNeeded = $true } + #Remove these 4 lines below for testing. Only needed to pass checks for GitHub + $ServerName = 'PR01.contoso.com' + $SiteCode = 'PRI' + $SiteName = 'Contoso' + $ConfigMgrVersion = 2006 + $serverShortName = $ServerName.Split('.')[0] if ($serverShortName.Length -gt 4) @@ -554,14 +560,14 @@ $configurationData = @{ PSDscAllowPlainTextPassword = $true } ) -}#> +} $params = @{ ServerName = 'PR01.contoso.com' SiteCode = 'PRI' SiteName = 'Contoso' ConfigMgrVersion = 2006 - <#DomainCredential = Get-Credential -Username 'contoso\SCCM-CMInstall' -Message 'SCCM Install account' + DomainCredential = Get-Credential -Username 'contoso\SCCM-CMInstall' -Message 'SCCM Install account' SqlServiceCredential = Get-Credential -Username 'contoso\SCCM-SqlSvc' -Message 'SCCM SQL Service account' SqlAgentServiceCredential = Get-Credential -Username 'contoso\SCCM-SqlAgt' -Message 'SCCM SQL Agent account' SccmInstallAccount = Get-Credential -Username 'contoso\SCCM-CMInstall' -Message 'SCCM Install account' @@ -569,7 +575,7 @@ $params = @{ Get-Credential -Username 'contoso\SCCM-Network' -Message 'SCCM Network Service account' Get-Credential -Username 'contoso\SCCM-ClientPush' -Message 'SCCM Client Push account' Get-Credential -Username 'contoso\SCCM-ADJoin' -Message 'SCCM AD Join account' - )#> + ) } -#PrimaryInstall -ConfigurationData $configurationData -OutputPath C:\Temp\Primary @params +PrimaryInstall -ConfigurationData $configurationData -OutputPath C:\Temp\Primary @params#> From 7b53f6008033c5e9289816dca862a82d8ce9774b Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Wed, 4 Nov 2020 08:39:48 -0500 Subject: [PATCH 13/17] Solidifying example --- source/Examples/PrimaryInstall.ps1 | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index 681b84d..19124f3 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -11,7 +11,8 @@ ADK, MDT, SQL, and SCCM source media are required in order to use this example. Please examine the Import-DscResource statements and ensure that the appropriate modules are installed. Replace the line items specified with entries appropriate to your environment. - Uncomment the blocks at the bottom for configuration data and parameters and define the parameters as desired. + Uncomment lines 24 and 575. This is only needed to pass tests that aren't designed for a composite configuration. + Define the parameters as desired. Ensure the SCCM install is not on a drive that is specified for xSccmPreReqs NoSmsOnDrives. Ensure the SQLInstall SqlPort is not the same as SQLSSBPort in the SCCM ini file. @@ -21,7 +22,7 @@ Please note: this example provides no methodology to encrypt the mof file and any credentials will be saved in the mof in plain text. #> -Configuration PrimaryInstall +<#Configuration PrimaryInstall { [CmdletBinding()] param @@ -77,12 +78,6 @@ Configuration PrimaryInstall RebootNodeIfNeeded = $true } - #Remove these 4 lines below for testing. Only needed to pass checks for GitHub - $ServerName = 'PR01.contoso.com' - $SiteCode = 'PRI' - $SiteName = 'Contoso' - $ConfigMgrVersion = 2006 - $serverShortName = $ServerName.Split('.')[0] if ($serverShortName.Length -gt 4) @@ -551,7 +546,7 @@ Configuration PrimaryInstall } } } -<# + $configurationData = @{ AllNodes = @( @{ From 4c255e95b0b9ad607e9cd484d356bb0b10191aef Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Wed, 4 Nov 2020 09:36:58 -0500 Subject: [PATCH 14/17] Hard coding example data --- source/Examples/PrimaryInstall.ps1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index 19124f3..e27f6d5 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -11,8 +11,7 @@ ADK, MDT, SQL, and SCCM source media are required in order to use this example. Please examine the Import-DscResource statements and ensure that the appropriate modules are installed. Replace the line items specified with entries appropriate to your environment. - Uncomment lines 24 and 575. This is only needed to pass tests that aren't designed for a composite configuration. - Define the parameters as desired. + Uncomment blocks at the end to allow parameter usage and specify parameters as desired. Ensure the SCCM install is not on a drive that is specified for xSccmPreReqs NoSmsOnDrives. Ensure the SQLInstall SqlPort is not the same as SQLSSBPort in the SCCM ini file. @@ -22,7 +21,7 @@ Please note: this example provides no methodology to encrypt the mof file and any credentials will be saved in the mof in plain text. #> -<#Configuration PrimaryInstall +Configuration PrimaryInstall { [CmdletBinding()] param @@ -78,6 +77,12 @@ RebootNodeIfNeeded = $true } + # Hard-coding params to allow tests to pass. Remove these + $ServerName = 'PR01.contoso.com' + $SiteCode = 'PRI' + $SiteName = 'Contoso' + $ConfigMgrVersion = 2006 + $serverShortName = $ServerName.Split('.')[0] if ($serverShortName.Length -gt 4) @@ -556,7 +561,7 @@ $configurationData = @{ } ) } - +<# $params = @{ ServerName = 'PR01.contoso.com' SiteCode = 'PRI' From c8042a72deae5de6d998d2fe5affcd717c9b84cc Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Wed, 4 Nov 2020 09:51:49 -0500 Subject: [PATCH 15/17] Making PSCred paramaters mandatory --- source/Examples/PrimaryInstall.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index e27f6d5..dd03612 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -38,23 +38,23 @@ Configuration PrimaryInstall [System.String] $SiteCode, - [Parameter()] + [Parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $DomainCredential, - [Parameter()] + [Parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $SqlServiceCredential, - [Parameter()] + [Parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $SqlAgentServiceCredential, - [Parameter()] + [Parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $SccmInstallAccount, - [Parameter()] + [Parameter(Mandatory = $true)] [System.Management.Automation.PSCredential[]] $CMAccounts, From 7a127c78fc0f2cc390d2e5e9f50e22979f5f1ca5 Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Wed, 4 Nov 2020 10:02:33 -0500 Subject: [PATCH 16/17] Removing mandatory from parameter --- source/Examples/PrimaryInstall.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index dd03612..62066bf 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -54,7 +54,7 @@ Configuration PrimaryInstall [System.Management.Automation.PSCredential] $SccmInstallAccount, - [Parameter(Mandatory = $true)] + [Parameter()] [System.Management.Automation.PSCredential[]] $CMAccounts, From e40b5b1b6b155db262b8ec5a43a50b22fa36dbec Mon Sep 17 00:00:00 2001 From: Nicholas Ellis Date: Wed, 4 Nov 2020 10:18:55 -0500 Subject: [PATCH 17/17] Managing CMAccounts data --- source/Examples/PrimaryInstall.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/Examples/PrimaryInstall.ps1 b/source/Examples/PrimaryInstall.ps1 index 62066bf..0a8651e 100644 --- a/source/Examples/PrimaryInstall.ps1 +++ b/source/Examples/PrimaryInstall.ps1 @@ -82,6 +82,11 @@ Configuration PrimaryInstall $SiteCode = 'PRI' $SiteName = 'Contoso' $ConfigMgrVersion = 2006 + $CMAccounts = @( + New-Object System.Management.Automation.PSCredential('contoso\SCCM-Network', $(Convertto-SecureString -AsPlainText -String 'Generic' -Force)) + New-Object System.Management.Automation.PSCredential('contoso\SCCM-ClientPush', $(Convertto-SecureString -AsPlainText -String 'Generic' -Force)) + New-Object System.Management.Automation.PSCredential('contoso\SCCM-AdJoin', $(Convertto-SecureString -AsPlainText -String 'Generic' -Force)) + ) $serverShortName = $ServerName.Split('.')[0] @@ -105,7 +110,7 @@ Configuration PrimaryInstall $winPeProductID = '353df250-4ecc-4656-a950-4df93078a5fd' } - #SCCM PreReqs + # SCCM PreReqs xSccmPreReqs SCCMPreReqs { InstallAdk = $true @@ -253,7 +258,7 @@ Configuration PrimaryInstall DependsOn = '[xSccmInstall]SccmInstall' } - #region ConfigCBMgr configurations + # region ConfigCBMgr configurations foreach ($account in $CMAccounts) { CMAccounts "AddingAccount-$($account.Username)"