%3CLINGO-SUB%20id%3D%22lingo-sub-394074%22%20slang%3D%22en-US%22%3ERe%3A%20Configuring%20a%20PowerShell%20DSC%20Web%20Pull%20Server%20to%20use%20SQL%20Database%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-394074%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%20may%20have%20noticed%2C%20we're%20using%20%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20bold%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3E%20%3CEM%20style%3D%22box-sizing%3A%20border-box%3B%22%3E%20Provider%3DSQLOLEDB.1%3C%2FEM%3E%3C%2FSTRONG%3E%20to%20connect%20to%20our%20SQL%20server%20which%20may%20introduce%20issues%20when%20TLS%20v1.2%20is%20required.%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20leverage%20TLS%20v1.2%20you%20can%20follow%20these%20steps%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%26nbsp%3B-%20download%20the%26nbsp%3B%3CA%20title%3D%22SQL%202008%20and%202008%20R2%20TLS%201.2%20SQL%20Native%20Client%20updates%20not%20available%20in%20Windows%20Catalog%22%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fdownload%2Fdetails.aspx%3Fid%3D57606%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESQL%202008%20and%202008%20R2%20TLS%201.2%20SQL%20Native%20Client%20update%3C%2FA%3E%20or%26nbsp%3B%3CA%20title%3D%22Latest%20servicing%20update%20available%20for%20the%20Microsoft%C2%AE%20SQL%20Server%C2%AE%202012%20Native%20Client%22%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fdownload%2Fdetails.aspx%3Fid%3D50402%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%C2%AE%20SQL%20Server%C2%AE%202012%20Native%20Client%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E-%20install%20the%20SQL%20client%20on%20your%20DSC%20Web%20Pull%20Server%3C%2FLI%3E%0A%3CLI%3E-%20open%20the%20web.config%20with%20your%20favorite%20editor%20and%20change%26nbsp%3B%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%3CSTRONG%3E%3CADD%20key%3D%22%26quot%3Bdbconnectionstr%26quot%3B%22%20value%3D%22%26quot%3B%26lt%3BU%22%3E%3CEM%3EProvider%3DSQLOLEDB.1%3C%2FEM%3E%3BIntegrated%20Security%3DSSPI%3BPersist%20Security%20Info%3DFalse%3BInitial%20Catalog%3Dmaster%3BData%20Source%3DSQL%5CDSC%22%20%2F%26gt%3B%3C%2FADD%3E%3C%2FSTRONG%3E%20to%26nbsp%3B%3CSTRONG%3E%3CADD%20key%3D%22%26quot%3Bdbconnectionstr%26quot%3B%22%20value%3D%22%26quot%3B%26lt%3BU%22%3E%3CEM%3EProvider%3DSQLNCLI11%3C%2FEM%3E%3BIntegrated%20Security%3DSSPI%3BPersist%20Security%20Info%3DFalse%3BInitial%20Catalog%3Dmaster%3BData%20Source%3DSQL%5CDSC%22%20%2F%26gt%3B%3C%2FADD%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EThis%20enables%20our%20DSC%20Web%20Pull%20Server%20to%20use%20the%20SQL%20native%20client.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHappy%20DSC-ing%26nbsp%3B%3CIMG%20id%3D%22smileyhappy%22%20class%3D%22emoticon%20emoticon-smileyhappy%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Fi%2Fsmilies%2F16x16_smiley-happy.png%22%20alt%3D%22Smiley%20Happy%22%20title%3D%22Smiley%20Happy%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-259626%22%20slang%3D%22en-US%22%3EConfiguring%20a%20PowerShell%20DSC%20Web%20Pull%20Server%20to%20use%20SQL%20Database%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-259626%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EFirst%20published%20on%20TechNet%20on%20Jul%2009%2C%202018%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1710309025%22%20id%3D%22toc-hId-1710309025%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId--841847936%22%20id%3D%22toc-hId--841847936%22%3EIntroduction%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHi!%20Thank%20you%20for%20visiting%20this%20blog%20to%20find%20out%20more%20about%20how%20you%20can%20configure%20a%20PowerShell%20DSC%20Web%20Pull%20Server%20to%20use%20an%20SQL%20database%20instead%20of%20the%20%22Devices.edb%22%20solution%20we%20currently%20use.%20Since%20you%20made%20it%20his%20far%20I%20assume%20that%20you're%20already%20familiar%20with%20PowerShell%20and%20PowerShell%20Desired%20State%20Configuration%20but%20if%20not%2C%20I%20encourage%20you%20to%20read%20more%20about%20%5B%23%24dp4%5D%20PowerShell%20%20and%20%5B%23%24dp5%5D%20PowerShell%20Desired%20State%20Configuration%20%20.%20Either%20way%2C%20you%20are%20probably%20ready%20to%20experiment%20with%20Desired%20State%20Configuration%20or%20ready%20to%20implement%20a%20Desired%20State%20Configuration%20architecture%20within%20your%20environment%20(perhaps%20even%20production).%20I%20wrote%20this%20blog%20post%20to%20show%20you%20how%20you%20can%20implement%20an%20example%20Desired%20State%20Configuration%20environment%20where%20the%20Secure%20Pull%20Web%20Server%20uses%20a%20SQL%20database%20to%20store%20all%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-900962399%22%20id%3D%22toc-hId-900962399%22%3EAbout%20me%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBefore%20I%20do%20so%20I%20will%20tell%20you%20a%20little%20bit%20about%20myself.%20My%20name%20is%20Serge%20Zuidinga%20and%20I'm%20a%20Dutch%20Premier%20Field%20Engineer%20with%20System%20Center%20Operations%20Manager%20as%20my%20core%20technology.%20I%20started%20working%20at%20Microsoft%20in%20September%202014%20focusing%20on%20supporting%20customers%20with%20their%20Operations%20Manager%20environment(s)%20and%2C%20among%20other%20things%2C%20the%20integration%20with%20automation%20products%20like%20System%20Center%20Orchestrator.%20I%20always%20had%20a%20passion%20for%20scripting%20and%20application%20development%20so%20this%20was%20the%20ideal%20situation%20for%20me%20since%20I%20could%20use%20my%20passion%20for%20PowerShell%20in%20combination%20with%20Operations%20Manager%20and%20Orchestrator.%20I've%20been%20seriously%20working%20with%20PowerShell%20ever%20since%20and%20am%20currently%20involved%20with%20not%20only%20System%20Center%20Operations%20Manager%20and%20Orchestrator%20but%20with%20Azure%20in%20general%20and%20Azure%20Automation%2C%20OMS%2C%20EMS%2C%20Operations%20Manager%20Management%20Pack%20Authoring%2C%20Visual%20Studio%2C%20Visual%20Studio%20Team%20Foundation%20Server%2C%20PowerShell%20and%20PowerShell%20Desired%20State%20Configuration%20in%20particular.%20I%20currently%20also%20support%20customer%20in%20designing%20and%20building%20a%20%5B%23%24dp7%5D%20Continuous%20Integration%20and%20Continuous%20Deployment%20pipeline%20with%20Desired%20State%20Configuration%20and%20Visual%20Studio%20Team%20Foundation%20Server%20%20besides%20Operations%20Manager%2C%20Orchestrator%20and%20Operations%20Management%20Suite.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1651194562%22%20id%3D%22toc-hId--1651194562%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId-91615773%22%20id%3D%22toc-hId-91615773%22%3ELet's%20get%20started%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGlad%20to%20see%20you%20made%20it%20through%20the%20introduction.%20So%2C%20this%20is%20the%20plan%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EStep%201%3A%20the%20prerequisites%3C%2FLI%3E%0A%3CLI%3EStep%202%3A%20implement%20our%20example%20environment%3C%2FLI%3E%0A%3CLI%3EStep%203%3A%20watch%20it%20work%3C%2FLI%3E%0A%3CLI%3EStep%204%3A%20enjoy%20our%20accomplishments%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH3%20id%3D%22toc-hId-1637912603%22%20id%3D%22toc-hId-1637912603%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--914244358%22%20id%3D%22toc-hId--914244358%22%3EPrerequisites%3C%2FH3%3E%0A%3CP%3EWindows%20Server%202019%20Technical%20Preview%20To%20be%20able%20to%20leverage%20the%20ability%20to%20use%20an%20SQL%20database%20with%20our%20pull%20server%2C%20we%20need%20to%20deploy%20a%20Windows%20Server%202019%20Technical%20Preview%20server%20which%20holds%20the%20version%20of%20WMF%205.1%20that%20includes%20the%20ability%20to%20connect%20to%20SQL%20server.%20We%20should%20make%20sure%20that%20we%20have%20the%20latest%20version%20of%20Windows%20Server%202019%20Technical%20Preview%20installed%20since%2C%20at%20least%20up%20until%20build%2017639%2C%20the%20MUI%20file%20could%20be%20missing%20required%20elements%20to%20support%20SQL%20server.%20%3CSPAN%20style%3D%22%22%3E%3CSTRONG%3ENote%20%3C%2FSTRONG%3E%20%3C%2FSPAN%3E%20%3A%20there%20is%20currently%20no%20support%20for%20SQL%20with%20DSC%20on%20Windows%20Server%202016%20(or%20previous%20Windows%20Server%20versions)%20even%20though%20WMF%205.1%20is%20available%20for%20Windows%20Server%202016!%20If%20you%20want%2C%20you%20can%20read%20all%20about%20the%20supported%20database%20systems%20for%20WMF%20versions%204.0%20and%20higher%20at%20%3CA%3E%20Desired%20State%20Configuration%20Pull%20Service%20%3C%2FA%3E%20(%22Supported%20database%20systems%22-section)%20and%20please%20check%20out%20%3CA%3E%20this%20great%20post%20%3C%2FA%3E%20by%20Raimund%20Andr%C3%A9e%20on%20how%20to%20use%20a%20SQL%20server%202016%20as%20the%20backend%20database%20for%20a%20Desired%20State%20Pull%20Server.%20We%20also%20need%20to%20make%20sure%20that%20we%20have%20version%208.2.0.0%20(or%20higher)%20of%20the%20%22xPSDesiredStateConfiguration%22-module%20installed%20on%20our%20Windows%20Server%202019%20Technical%20Preview%20server.%20%3CEM%3E%3CSTRONG%3EHint%20%3C%2FSTRONG%3E%20%3A%20Find-Module%20-Name%20xPSDesiredStateConfiguration%20%7C%20Install-Module%20%3C%2FEM%3E%20%3CSTRONG%3E%3CSTRONG%3E%20Note%20%3C%2FSTRONG%3E%3C%2FSTRONG%3E%20%3A%20version%208.3.0.0%20is%20the%20latest%20version%20of%20the%20%22xPSDesiredStateConfiguration%22-module%20at%20the%20time%20this%20blog%20post%20was%20written%20A%20certificate%20for%20enabling%20a%20HTTPS%20binding%20within%20IIS%20is%20also%20required%20for%20our%20example%20environment%20to%20work%20so%20please%20make%20sure%20you%20have%20a%20web%20server%20certificate%20installed%20on%20your%20Windows%20Server%202019%20Technical%20Preview%20server%20along%20with%20the%20%22xPSDesiredStateConfiguration%22-module.%20Finally%2C%20access%20to%20any%20SQL%20server%20instance%20to%20host%20our%20database.%20From%20a%20firewall%20perspective%2C%20we%20only%20need%20access%20to%20the%20TCP%20port%20the%20SQL%20server%20instance%20is%20listening%20on%20from%20our%20pull%20server.%20There's%20no%20need%20to%20create%20a%20database%20upfront%20since%20this%20will%20be%20taken%20care%20of%20by%20our%20pull%20server%20(our%20database%20will%20always%20be%20created%20with%20%22DSC%22%20as%20the%20name%20for%20our%20database)%20and%20both%20SQL%20and%20Windows%20Authentication%20is%20supported.%20%3CSTRONG%3E%3CSTRONG%3ENote%20%3C%2FSTRONG%3E%3C%2FSTRONG%3E%20%3A%20you%20can%20use%20a%20Domain%20User%20account%20instead%20of%20the%20%22Local%20System%22-account%20the%20IIS%20AppPool%20is%20configured%20with%20by%20default.%20If%20you%20want%20to%20use%20a%20Domain%20User%20account%2C%20you%20only%20need%20to%20make%20sure%20that%20it%20has%20%22dbcreator%22-permissions%20configured%20for%20the%20SQL%20Server%20instance%20that%20will%20host%20the%20%22DSC%22-database%20Let's%20get%20cracking!%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-828565977%22%20id%3D%22toc-hId-828565977%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--1723590984%22%20id%3D%22toc-hId--1723590984%22%3EImplement%20a%20Secure%20Web%20Pull%20Server%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EStep%201%3A%20Install%20the%20PowerShell%20Desired%20State%20Configuration%20by%20using%20%22Add%20Roles%20and%20features%22%20available%20through%20Server%20Manager%20or%20from%20PowerShell%3A%20%3CSTRONG%3E%20%3CEM%3E%20Add-WindowsFeature%20-Name%20DSC-Service%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EStep%202%3A%20Get%20the%20thumbprint%20of%20our%20web%20server%20certificate%20we%20are%20going%20to%20use%20for%20our%20HTTPS%20binding%3A%20%3CSTRONG%3E%20%3CEM%3E%20Get-ChildItem%20-Path%20Cert%3A%5CLocalMachine%5CMy%5C%20-SSLServerAuthentication%20%3C%2FEM%3E%20%3C%2FSTRONG%3E%20Get%20a%20unique%20GUID%20that%20we%20are%20going%20to%20use%20as%20a%20registration%20key%3A%20%3CSTRONG%3E%20%3CEM%3E%20(New-Guid).Guid%20%3C%2FEM%3E%20%3C%2FSTRONG%3E%20Get%20the%20SQL%20connection%20string%20that%20will%20allow%20our%20pull%20server%20to%20connect%20to%20the%20appropriate%20SQL%20server%20instance%20or%20modify%20and%20use%20one%20of%20the%20following%20examples%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EWindows%20Authentication%3A%20%3CSTRONG%3E%20%3CEM%3E%20Provider%3DSQLOLEDB.1%3BIntegrated%20Security%3DSSPI%3BPersist%20Security%20Info%3DFalse%3BInitial%20Catalog%3Dmaster%3BData%20Source%3DSQL%5CDSC%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3ESQL%20authentication%3A%20%3CSTRONG%3E%20%3CEM%3E%20Provider%3DSQLOLEDB.1%3BPassword%3D%22password%22%3BPersist%20Security%20Info%3DTrue%3BUser%20ID%3Duser%3BInitial%20Catalog%3Dmaster%3BData%20Source%3DSQL%5CDSC%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENote%20%3C%2FSTRONG%3E%20%3A%20you%20can%20leave%20%3CEM%3E%20Initial%20Catalog%3Dmaster%20%3C%2FEM%3E%20as%20is%20because%20we'll%20create%20and%20use%20a%20specific%20database%20(called%20%22DSC%22)%20for%20use%20with%20our%20pull%20server.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EStep%203%20Create%20a%20MOF%20file%20that%20we%20will%20use%20to%20configure%20our%20pull%20server.%20You%20can%20modify%20and%20use%20this%20example%3A%3C%2FP%3E%0A%3CP%20style%3D%22background%3A%20white%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%23%20%3D%3D%3D%20Arguments%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20%23%0A%23%20We%20got%20these%20from%20step%202%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0A%24Thumbprint%20%3D%20%22BF6E5EFC44A15FE238CDE2A77D9A12B07B0BA200%22%0A%24Guid%20%3D%20%225fd98d96-7864-4006-b60d-0a907a676c6a%22%0A%23%20%3D%3D%3D%20Arguments%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20%23%0A%0A%23%20%3D%3D%3D%20Section%20Secure%20Web%20Pull%20Server%20with%20SQL%20database%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%20%23%0AConfiguration%20SecureWebPullServerWithSQLDatabase%20%7B%0A%20%20Param(%5Bstring%5D%24NodeName%20%3D%20%22localhost%22%2C%0A%20%20%20%20%20%20%20%20%5Bstring%24Thumbprint%20%3D%20%22%24(Throw%20%22Provide%20a%20valid%20certificate%20thumbprint%20to%20continue%22)%22%2C%0A%20%20%20%20%20%20%20%20%5Bstring%5D%24Guid%20%3D%20%22%24(Throw%20%22Provide%20a%20valid%20GUID%20to%20continue%22)%22)%0A%0A%20%20Import-DscResource%20-ModuleName%20PSDesiredStateConfiguration%0A%20%20Import-DSCResource%20-ModuleName%20xPSDesiredStateConfiguration%0A%0A%20%20Node%20%24NodeName%20%7B%0A%20%20%20%20WindowsFeature%20DSCServiceFeature%20%7B%0A%20%20%20%20%20%20Ensure%20%3D%20%22Present%22%0A%20%20%20%20%20%20Name%20%3D%20%22DSC-Service%22%0A%20%20%20%20%7D%0A%0A%20%20%20%20xDscWebService%20SecureWebPullServer%20%7B%0A%20%20%20%20%20%20Ensure%20%3D%20%22Present%22%0A%20%20%20%20%20%20EndpointName%20%3D%20%22SecureWebPullServer%22%0A%20%20%20%20%20%20Port%20%3D%20443%0A%20%20%20%20%20%20PhysicalPath%20%3D%20%22C%3A%5CProgram%20Files%5CWindowsPowerShell%5CDscService%5CSecureWebPullServer%5CWebsite%22%0A%20%20%20%20%20%20CertificateThumbPrint%20%3D%20%24Thumbprint%0A%20%20%20%20%20%20ModulePath%20%3D%20%22C%3A%5CProgram%20Files%5CWindowsPowerShell%5CDscService%5CSecureWebPullServer%5CModules%22%0A%20%20%20%20%20%20ConfigurationPath%20%3D%20%22C%3A%5CProgram%20Files%5CWindowsPowerShell%5CDscService%5CSecureWebPullServer%5CConfiguration%22%0A%20%20%20%20%20%20State%20%3D%20%22Started%22%0A%20%20%20%20%20%20DependsOn%20%3D%20%22%5BWindowsFeature%5DDSCServiceFeature%22%0A%20%20%20%20%20%20RegistrationKeyPath%20%3D%20%22C%3A%5CProgram%20Files%5CWindowsPowerShell%5CDscService%22%0A%20%20%20%20%20%20AcceptSelfSignedCertificates%20%3D%20%24true%0A%20%20%20%20%20%20UseSecurityBestPractices%20%3D%20%24true%0A%20%20%20%20%20%20SqlProvider%20%3D%20%24true%0A%20%20%20%20%20%20SqlConnectionString%20%3D%20%22Provider%3DSQLOLEDB.1%3BIntegrated%20Security%3DSSPI%3BPersist%20Security%20Info%3DFalse%3BInitial%20Catalog%3Dmaster%3BData%20Source%3DPUT_DMZ_SQL_SERVER_INSTANCE_HERE%22%0A%20%20%20%20%7D%0A%0A%20%20%20%20WindowsFeature%20IISMGMTConsole%20%7B%0A%20%20%20%20%20%20Ensure%20%3D%20%22Present%22%0A%20%20%20%20%20%20Name%20%3D%20%22Web-Mgmt-Console%22%0A%20%20%20%20%20%20DependsOn%20%3D%20%22%5BxDscWebService%5DSecureWebPullServer%22%0A%20%20%20%20%7D%0A%0A%20%20%20%20File%20RegistrationKeyFile%20%7B%0A%20%20%20%20%20%20Ensure%20%3D%20%22Present%22%0A%20%20%20%20%20%20Type%20%3D%20%22File%22%0A%20%20%20%20%20%20DestinationPath%20%3D%20%22C%3A%5CProgram%20Files%5CWindowsPowerShell%5CDscService%5CRegistrationKeys.txt%22%0A%20%20%20%20%20%20Contents%20%3D%20%24Guid%0A%20%20%20%20%20%20DependsOn%20%3D%20%22%5BxDscWebService%5DSecureWebPullServer%22%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A%0A%23%20%3D%3D%3D%20Section%20Secure%20Web%20Pull%20Server%20with%20SQL%20database%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%20%23%0A%0ASecureWebPullServerWithSQLDatabase%20-NodeName%20PUT_SERVER_FQDN_HERE%20-Thumbprint%20%24Thumbprint%20-Guid%20%24Guid%20-OutputPath%20C%3A%5CWindows%5CTemp%20-Verbose%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EJust%20open%20it%20in%20Windows%20PowerShell%20ISE%20(I%20use%20Visual%20Studio%20Code%20but%20you%20can%20use%20any%20editor%20of%20your%20preference)%20and%20make%20the%20necessary%20modifications%20(at%20least%20the%20thumbprint%20and%20registration%20key).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAssuming%20the%20previous%20steps%20went%20well%2C%20we%20should%20now%20have%20a%20MOF%20file%20in%20C%3A%5CWindows%5CTemp%20on%20our%20Windows%20Server%202019%20Technical%20Preview%20server.%3C%2FP%3E%0A%3CP%3ELet's%20get%20our%20pull%20server%20configured%20by%20consuming%20the%20MOF%20file%20we%20just%20created%3A%20%3CSTRONG%3E%20%3CEM%3E%20Start-DscConfiguration%20-Path%20C%3A%5CWindows%5CTemp%20-Wait%20-Verbose%3C%2FEM%3E%3C%2FSTRONG%3E%20%3C%2FP%3E%0A%3CP%3E%20Our%20pull%20server%20has%20now%20been%20configured%20and%20we%20are%20ready%20to%20host%20(partial)%20configurations%20and%20have%20clients%20connect%20to%20consume%20the%20appropriate%20configurations.%3C%2FP%3E%0A%3CP%3EWe%20will%20create%20such%20a%20partial%20configuration%20as%20an%20example%20so%20that%20we%20can%20serve%20any%20connected%20clients.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%2C%20like%20what%20we%20just%20did%20we%20can%20create%20a%20configuration%20and%20MOF%20file%20that%20our%20client(s)%20will%20consume.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20modify%20and%20use%20this%20example%3A%3C%2FP%3E%0A%3CP%20style%3D%22background%3A%20white%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EConfiguration%20TelnetClient%20%7B%0A%20%20%20%20Import-DscResource%20-ModuleName%20PSDesiredStateConfiguration%0A%0A%20%20%20%20Node%20TelnetClient%20%7B%0A%20%20%20%20%20%20%20%20WindowsFeature%20TelnetClient%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20Name%20%20%20%3D%20'Telnet-Client'%0A%20%20%20%20%20%20%20%20%20%20%20%20Ensure%20%3D%20'Present'%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%0A%0ATelnetClient%20-OutputPath%20%E2%80%9CC%3A%5CProgram%20Files%5CWindowsPowerShell%5CDscService%5CSecureWebPullServer%5CConfiguration%E2%80%9D%20-Verbose%20%0A%0ANew-DscChecksum%20-Path%20%E2%80%9CC%3A%5CProgram%20Files%5CWindowsPowerShell%5CDscService%5CSecureWebPullServer%5CConfiguration%E2%80%9D%20-OutPath%20%E2%80%9CC%3A%5CProgram%20Files%5CWindowsPowerShell%5CDscService%5CSecureWebPullServer%5CConfiguration%E2%80%9D%20-Verbose%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%20style%3D%22background%3A%20white%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20are%20now%20ready%20to%20connect%20one%20or%20more%20clients%20to%20our%20pull%20server.%20You%20can%20modify%20and%20use%20the%20following%20example%20on%20a%20Windows%20Server%20(for%20this%20example%20you%20should%20not%20use%20your%20pull%20server)%20that%20you%20want%20to%20connect%20to%20our%20pull%20server%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%5BDscLocalConfigurationManager()%5D%0AConfiguration%20PartialConfig%20%7B%0A%20%20%20%20Param(%5Bstring%5D%24NodeName%20%3D%20'localhost')%0A%20%20%20%20Node%20%24NodeName%20%7B%0A%20%20%20%20%20%20%20%20Settings%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20RefreshFrequencyMins%20%20%20%20%20%20%20%20%20%20%20%20%3D%2030%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20RefreshMode%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%22PULL%22%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20ConfigurationMode%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%22ApplyAndAutocorrect%22%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20AllowModuleOverwrite%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%24true%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20RebootNodeIfNeeded%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%24true%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20ConfigurationModeFrequencyMins%20%20%3D%2060%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20ConfigurationRepositoryWeb%20PullServer%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20ServerURL%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%22https%3A%2F%2FFQDN_SECURE_WEB_PULL_SERVER%2FPSDSCPullServer.svc%2F%22%0A%20%20%20%20%20%20%20%20%20%20%20%20RegistrationKey%20%20%20%20%20%20%20%20%20%3D%20%225fd98d96-7864-4006-b60d-0a907a676c6a%22%0A%20%20%20%20%20%20%20%20%20%20%20%20ConfigurationNames%20%20%20%20%20%20%3D%20%40(%22TelnetClient%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%23ConfigurationNames%20%20%20%20%20%20%3D%20%40(%22TelnetClient%22%2C%22Web-Mgmt-Console%22)%20%23%20Multiple%20partial%20configurations%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20ReportServerWeb%20PullServer%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20ServerURL%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%22https%3A%2F%2FFQDN_SECURE_WEB_PULL_SERVER%2FPSDSCPullServer.svc%2F%22%0A%20%20%20%20%20%20%20%20%20%20%20%20RegistrationKey%20%20%20%20%20%20%20%20%20%3D%20%225fd98d96-7864-4006-b60d-0a907a676c6a%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20PartialConfiguration%20TelnetClient%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20Description%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%22Installs%20the%20Telnet%20Client%22%0A%20%20%20%20%20%20%20%20%20%20%20%20ConfigurationSource%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%40(%22%5BConfigurationRepositoryWeb%5DPullServer%22)%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%0APartialConfig%20-OutputPath%20C%3A%5CWindows%5CTemp%20-Verbose%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%20style%3D%22background%3A%20white%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAssuming%20the%20previous%20steps%20went%20well%2C%20we%20should%20now%20have%20a%20Meta%20MOF%20file%20in%20C%3A%5CWindows%5CTemp%20on%20our%20Windows%20Server%202019%20Technical%20Preview%20server%20that%20allows%20for%20configuring%20the%20Local%20Configuration%20Manager.%3C%2FP%3E%0A%3CP%3ETo%20configure%20the%20LCM%20to%20actually%20connect%20to%20and%20retrieve%20(a)%20configuration(s)%20from%20our%20pull%20server%2C%20we%20just%20need%20to%20execute%3A%20%3CSTRONG%3E%20%3CEM%3E%20Set-DscLocalConfigurationManager%20-Path%20C%3A%5CWindows%5CTemp%20-Verbose%20%3C%2FEM%3E%20%3C%2FSTRONG%3E%20Step%204%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECongratulations%20on%20implementing%20your%20pull%20server%20with%20a%20SQL%20database!%20Sit%20back%20and%20enjoy%20your%20newly%20installed%20and%20configured%20PowerShell%20DSC%20Secure%20Web%20Pull%20server%20with%20a%20SQL%20database!%20Stay%20tuned%20for%20the%20next%20post%20were%20I%20will%20tell%20you%20more%20on%20how%20you%20can%20pull%20reports.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3E%3CSTRONG%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3EDisclaimer%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3C%2FFONT%3E%3C%2FEM%3E%3C%2FSTRONG%3E%3CEM%3E%3CFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3EThe%20sample%20scripts%20are%20not%20supported%20under%20any%20Microsoft%20standard%20support%20program%20or%20service.%20The%20sample%20scripts%20are%20provided%20AS%20IS%20without%20warranty%20of%20any%20kind.%20Microsoft%20further%20disclaims%20all%20implied%20warranties%20including%2C%20without%20limitation%2C%20any%20implied%20warranties%20of%20merchantability%20or%20of%20fitness%20for%20a%20particular%20purpose.%20The%20entire%20risk%20arising%20out%20of%20the%20use%20or%20performance%20of%20the%20sample%20scripts%20and%20documentation%20remains%20with%20you.%20In%20no%20event%20shall%20Microsoft%2C%20its%20authors%2C%20or%20anyone%20else%20involved%20in%20the%20creation%2C%20production%2C%20or%20delivery%20of%20the%20scripts%20be%20liable%20for%20any%20damages%20whatsoever%20(including%2C%20without%20limitation%2C%20damages%20for%20loss%20of%20business%20profits%2C%20business%20interruption%2C%20loss%20of%20business%20information%2C%20or%20other%20pecuniary%20loss)%20arising%20out%20of%20the%20use%20of%20or%20inability%20to%20use%20the%20sample%20scripts%20or%20documentation%2C%20even%20if%20Microsoft%20has%20been%20advised%20of%20the%20possibility%20of%20such%20damages.%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FEM%3E%3CFONT%3E%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-259626%22%20slang%3D%22en-US%22%3E%3CP%3EFirst%20published%20on%20TechNet%20on%20Jul%2009%2C%202018%20Introduction%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHi!%20Thank%20you%20for%20visiting%20this%20blog%20to%20find%20out%20more%20about%20how%20you%20can%20configure%20a%20PowerShell%20DSC%20Web%20Pull%20Server%20to%20use%20an%20SQL%20database%20instead%20of%20the%20%22Devices.edb%22%20solution%20we%20currently%20use.%20Since%20you%20made%20it%20his%20far%20I%20assume%20that%20you're%20already%20familiar%20with%20PowerShell%20and%20PowerShell%20Desired%20State%20Configuration%20but%20if%20not%2C%20I%20encourage%20you%20to%20read%20more%20about%20%5B%23%24dp4%5D%20PowerShell%20%20and%20%5B%23%24dp5%5D%20PowerShell%20Desired%20State%20Configuration%20%20.%20Either%20way%2C%20you%20are%20probably%20ready%20to%20experiment%20with%20Desired%20State%20Configuration%20or%20ready%20to%20implement%20a%20Desired%20State%20Configuration%20architecture%20within%20your%20environment%20(perhaps%20even%20production).%20I%20wrote%20this%20blog%20post%20to%20show%20you%20how%20you%20can%20implement%20an%20example%20Desired%20State%20Configuration%20environment%20where%20the%20Secure%20Pull%20Web%20Server%20uses%20a%20SQL%20database%20to%20store%20all%20data.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-259626%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESergeZuidinga%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

 

First published on TechNet on Jul 09, 2018

 

Introduction

 

Hi! Thank you for visiting this blog to find out more about how you can configure a PowerShell DSC Web Pull Server to use an SQL database instead of the "Devices.edb" solution we currently use.

 

Since you made it his far I assume that you're already familiar with PowerShell and PowerShell Desired State Configuration but if not, I encourage you to read more about PowerShell and PowerShell Desired State Configuration.

 

Either way, you are probably ready to experiment with Desired State Configuration or ready to implement a Desired State Configuration architecture within your environment (perhaps even production).

 

I wrote this blog post to show you how you can implement an example Desired State Configuration environment where the Secure Pull Web Server uses a SQL database to store all data.

 

About me

 

Before I do so I will tell you a little bit about myself. My name is Serge Zuidinga and I'm a Dutch Premier Field Engineer with System Center Operations Manager as my core technology.

I started working at Microsoft in September 2014 focusing on supporting customers with their Operations Manager environment(s) and, among other things, the integration with automation products like System Center Orchestrator.

I always had a passion for scripting and application development so this was the ideal situation for me since I could use my passion for PowerShell in combination with Operations Manager and Orchestrator.

I've been seriously working with PowerShell ever since and am currently involved with not only System Center Operations Manager and Orchestrator but with Azure in general and Azure Automation, OMS, EMS, Operations Manager Management Pack Authoring, Visual Studio, Visual Studio Team Foundation Server, PowerShell and PowerShell Desired State Configuration in particular.

 

Let's get started

 

Glad to see you made it through the introduction. So, this is the plan:

  • Step 1: the prerequisites
  • Step 2: implement our example environment
  • Step 3: watch it work
  • Step 4: enjoy our accomplishments

 

Prerequisites

 

Windows Server 2019 Technical Preview

 

To be able to leverage the ability to use an SQL database with our pull server, we need to deploy a Windows Server 2019 Technical Preview server which holds the version of WMF 5.1 that includes the ability to connect to SQL server.

 

We should make sure that we have the latest version of Windows Server 2019 Technical Preview installed since, at least up until build 17639, the MUI file could be missing required elements to support SQL server.

 

Note: There is currently no support for SQL with DSC on Windows Server 2016 (or previous Windows Server versions) even though WMF 5.1 is available for Windows Server 2016!

 

If you want, you can read all about the supported database systems for WMF versions 4.0 and higher at Desired State Configuration Pull Service (“Supported database systems”-section) and please check out this great post by Raimund Andrée on how to use a SQL server 2016 as the backend database for a Desired State Pull Server.

 

We also need to make sure that we have version 8.2.0.0 (or higher) of the “xPSDesiredStateConfiguration”-module installed on our Windows Server 2019 Technical Preview server.

 

Hint: Find-Module -Name xPSDesiredStateConfiguration | Install-Module

 

Note: version 8.3.0.0 is the latest version of the “xPSDesiredStateConfiguration”-module at the time this blog post was written

 

A certificate for enabling a HTTPS binding within IIS is also required for our example environment to work so please make sure you have a web server certificate installed on your Windows Server 2019 Technical Preview server along with the “xPSDesiredStateConfiguration”-module.

 

Finally, access to any SQL server instance to host our database.

 

From a firewall perspective, we only need access to the TCP port the SQL server instance is listening on from our pull server.

 

There’s no need to create a database upfront since this will be taken care of by our pull server (our database will always be created with “DSC” as the name for our database) and both SQL and Windows Authentication is supported.

 

Note: you can use a Domain User account instead of the “Local System”-account the IIS AppPool is configured with by default.

 

If you want to use a Domain User account, you only need to make sure that it has “dbcreator”-permissions configured for the SQL Server instance that will host the “DSC”-database

 

Let’s get cracking!

 

Implement a Secure Web Pull Server

 

Step 1: Install the PowerShell Desired State Configuration by using "Add Roles and features" available through Server Manager or from PowerShell: Add-WindowsFeature -Name DSC-Service

 

Step 2: Get the thumbprint of our web server certificate we are going to use for our HTTPS binding: Get-ChildItem -Path Cert:\LocalMachine\My\ -SSLServerAuthentication Get a unique GUID that we are going to use as a registration key: (New-Guid).Guid Get the SQL connection string that will allow our pull server to connect to the appropriate SQL server instance or modify and use one of the following examples:

 

  • Windows Authentication: Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=SQL\DSC
  • SQL authentication: Provider=SQLOLEDB.1;Password="password";Persist Security Info=True;User ID=user;Initial Catalog=master;Data Source=SQL\DSC

 

Note : you can leave Initial Catalog=master as is because we'll create and use a specific database (called "DSC") for use with our pull server.

 

Step 3 Create a MOF file that we will use to configure our pull server. You can modify and use this example:

 

 

# === Arguments ================================================ #
# We got these from step 2                                       #
$Thumbprint = "BF6E5EFC44A15FE238CDE2A77D9A12B07B0BA200"
$Guid = "5fd98d96-7864-4006-b60d-0a907a676c6a"
# === Arguments ================================================ #

# === Section Secure Web Pull Server with SQL database ========= #
Configuration SecureWebPullServerWithSQLDatabase {
  Param([string]$NodeName = "localhost",
        [string$Thumbprint = "$(Throw "Provide a valid certificate thumbprint to continue")",
        [string]$Guid = "$(Throw "Provide a valid GUID to continue")")

  Import-DscResource -ModuleName PSDesiredStateConfiguration
  Import-DSCResource -ModuleName xPSDesiredStateConfiguration

  Node $NodeName {
    WindowsFeature DSCServiceFeature {
      Ensure = "Present"
      Name = "DSC-Service"
    }

    xDscWebService SecureWebPullServer {
      Ensure = "Present"
      EndpointName = "SecureWebPullServer"
      Port = 443
      PhysicalPath = "C:\Program Files\WindowsPowerShell\DscService\SecureWebPullServer\Website"
      CertificateThumbPrint = $Thumbprint
      ModulePath = "C:\Program Files\WindowsPowerShell\DscService\SecureWebPullServer\Modules"
      ConfigurationPath = "C:\Program Files\WindowsPowerShell\DscService\SecureWebPullServer\Configuration"
      State = "Started"
      DependsOn = "[WindowsFeature]DSCServiceFeature"
      RegistrationKeyPath = "C:\Program Files\WindowsPowerShell\DscService"
      AcceptSelfSignedCertificates = $true
      UseSecurityBestPractices = $true
      SqlProvider = $true
      SqlConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=PUT_DMZ_SQL_SERVER_INSTANCE_HERE"
    }

    WindowsFeature IISMGMTConsole {
      Ensure = "Present"
      Name = "Web-Mgmt-Console"
      DependsOn = "[xDscWebService]SecureWebPullServer"
    }

    File RegistrationKeyFile {
      Ensure = "Present"
      Type = "File"
      DestinationPath = "C:\Program Files\WindowsPowerShell\DscService\RegistrationKeys.txt"
      Contents = $Guid
      DependsOn = "[xDscWebService]SecureWebPullServer"
    }
  }
}

# === Section Secure Web Pull Server with SQL database ========= #

SecureWebPullServerWithSQLDatabase -NodeName PUT_SERVER_FQDN_HERE -Thumbprint $Thumbprint -Guid $Guid -OutputPath C:\Windows\Temp -Verbose

 

 

Just open it in Windows PowerShell ISE (I use Visual Studio Code but you can use any editor of your preference) and make the necessary modifications (at least the thumbprint and registration key).

 

Assuming the previous steps went well, we should now have a MOF file in C:\Windows\Temp on our Windows Server 2019 Technical Preview server.

Let's get our pull server configured by consuming the MOF file we just created: Start-DscConfiguration -Path C:\Windows\Temp -Wait -Verbose

Our pull server has now been configured and we are ready to host (partial) configurations and have clients connect to consume the appropriate configurations.

We will create such a partial configuration as an example so that we can serve any connected clients.

 

So, like what we just did we can create a configuration and MOF file that our client(s) will consume.

 

You can modify and use this example:

 

 

Configuration TelnetClient {
    Import-DscResource -ModuleName PSDesiredStateConfiguration

    Node TelnetClient {
        WindowsFeature TelnetClient {
            Name   = 'Telnet-Client'
            Ensure = 'Present'
        }
    }
}

TelnetClient -OutputPath “C:\Program Files\WindowsPowerShell\DscService\SecureWebPullServer\Configuration” -Verbose 

New-DscChecksum -Path “C:\Program Files\WindowsPowerShell\DscService\SecureWebPullServer\Configuration” -OutPath “C:\Program Files\WindowsPowerShell\DscService\SecureWebPullServer\Configuration” -Verbose

 

 

We are now ready to connect one or more clients to our pull server. You can modify and use the following example on a Windows Server (for this example you should not use your pull server) that you want to connect to our pull server:

 

 

[DscLocalConfigurationManager()]
Configuration PartialConfig {
    Param([string]$NodeName = 'localhost')
    Node $NodeName {
        Settings {
            RefreshFrequencyMins            = 30;
            RefreshMode                     = "PULL";
            ConfigurationMode               ="ApplyAndAutocorrect";
            AllowModuleOverwrite            = $true;
            RebootNodeIfNeeded              = $true;
            ConfigurationModeFrequencyMins  = 60;
        }
        ConfigurationRepositoryWeb PullServer {
            ServerURL               = "https://FQDN_SECURE_WEB_PULL_SERVER/PSDSCPullServer.svc/"
            RegistrationKey         = "5fd98d96-7864-4006-b60d-0a907a676c6a"
            ConfigurationNames      = @("TelnetClient")
            #ConfigurationNames      = @("TelnetClient","Web-Mgmt-Console") # Multiple partial configurations
        }
        ReportServerWeb PullServer {
            ServerURL               = "https://FQDN_SECURE_WEB_PULL_SERVER/PSDSCPullServer.svc/"
            RegistrationKey         = "5fd98d96-7864-4006-b60d-0a907a676c6a"
        }
        PartialConfiguration TelnetClient {
            Description                     = "Installs the Telnet Client"
            ConfigurationSource             = @("[ConfigurationRepositoryWeb]PullServer")
        }
    }
}
PartialConfig -OutputPath C:\Windows\Temp -Verbose

 

 

Assuming the previous steps went well, we should now have a Meta MOF file in C:\Windows\Temp on our Windows Server 2019 Technical Preview server that allows for configuring the Local Configuration Manager.

To configure the LCM to actually connect to and retrieve (a) configuration(s) from our pull server, we just need to execute: Set-DscLocalConfigurationManager -Path C:\Windows\Temp -Verbose Step 4

 

Congratulations on implementing your pull server with a SQL database! Sit back and enjoy your newly installed and configured PowerShell DSC Secure Web Pull server with a SQL database! Stay tuned for the next post were I will tell you more on how you can pull reports.

 

 

Disclaimer
The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.

1 Comment
Microsoft

Hi,

 

As you may have noticed, we're using Provider=SQLOLEDB.1 to connect to our SQL server which may introduce issues when TLS v1.2 is required.

If you want to leverage TLS v1.2 you can follow these steps:

  1.  - download the SQL 2008 and 2008 R2 TLS 1.2 SQL Native Client update or Microsoft® SQL Server® 2012 Native Client
  2. - install the SQL client on your DSC Web Pull Server
  3. - open the web.config with your favorite editor and change <add key="dbconnectionstr" value="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=SQL\DSC" /> to <add key="dbconnectionstr" value="Provider=SQLNCLI11;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=SQL\DSC" />

This enables our DSC Web Pull Server to use the SQL native client.

 

Happy DSC-ing Smiley Happy