SqlSetup DsC Resource

Welcome Forums DSC (Desired State Configuration) SqlSetup DsC Resource

Viewing 2 reply threads
  • Author
    Posts
    • #163476
      Participant
      Topics: 2
      Replies: 2
      Points: 28
      Rank: Member

      Hi, powershell friends!

      I’m trying to use the powershell dscresource SqlSetup for automating sql server installations. However i’m struggling with errors when trying to pass credentials parameters, the mof file is generated with nodename.mof.error.

      My configuration mof file is like this:

      Import-DscResource -ModuleName SqlServerDsc
      
      node ExampleNode
      
      {
      WindowsFeature ‘NetFramework45’
      {
      Name = ‘NET-Framework-45-Core’
      Ensure = ‘Present’
      }
      
      SqlSetup ‘InstallDefaultInstance’
      {
      SourcePath = ‘C:\SQL2017’
      InstanceName = ‘PROTHEUS’
      AgtSvcAccount = ‘domain\user1’
      AgtSvcStartupType = ‘Automatic’
      BrowserSvcStartupType = ‘Automatic’
      Features = ‘SQLENGINE’
      InstallSharedDir = ‘E:\BIN\Program Files\Microsoft SQL Server’
      InstallSharedWOWDir = ‘E:\BIN\Program Files (x86)\Microsoft SQL Server’
      InstanceDir = ‘E:\DICT’
      InstanceID = ‘PROTHEUS’
      Sapwd = ‘totjahquonfdh12832719’
      SecurityMode = ‘SQL’
      SQLBackupDir = ‘F:\BACKUP\PROTHEUS’
      SQLCollation = ‘Latin1_General_BIN’
      SQLSvcAccount = ‘domain\user1’
      SqlSvcStartupType = ‘Automatic’
      SQLSysAdminAccounts = ‘domain\domaingroup’
      SQLTempDBDir = ‘E:\TEMPDB\PROTHEUS’
      SqlTempdbFileCount = ‘8’
      SqlTempdbFileGrowth = ‘256’
      SqlTempdbFileSize = ‘1024’
      SQLTempDBLogDir = ‘E:\TEMPDB\PROTHEUS’
      SqlTempdbLogFileGrowth = ‘256’
      SqlTempdbLogFileSize = ‘1024’
      SQLUserDBDir = ‘F:\DADOS\PROTHEUS’
      SQLUserDBLogDir = ‘E:\LOG\PROTHEUS’
      UpdateEnabled = ‘False’
      UpdateSource = ‘MU’
      DependsOn = ‘[WindowsFeature]NetFramework45’
      
      }
      }
      }
      
      

       

      Have anyone of you guys tried this Dsc resource?

      How can i pass credentials securely and unsecurely in powershell dsc configurations?

       

    • #163515
      Senior Moderator
      Topics: 9
      Replies: 1236
      Points: 4,443
      Helping Hand
      Rank: Community Hero

      Not a SQL guy and never used this resource, but from documentation all credentails are accepted as PSCredential, so you have to pass credential object and PFB articles on how to use credentials in DSC configuration.

      https://blogs.technet.microsoft.com/ashleymcglone/2015/12/18/using-credentials-with-psdscallowplaintextpassword-and-psdscallowdomainuser-in-powershell-dsc-configuration-data/

      Safely using PSCredentials in a Powershell DSC Configuration

    • #167251
      Participant
      Topics: 0
      Replies: 1
      Points: 28
      Rank: Member
Viewing 2 reply threads
  • The topic ‘SqlSetup DsC Resource’ is closed to new replies.