From f799c4adcc5fdd0e60ce667a377cf94da89ef898 Mon Sep 17 00:00:00 2001 From: Torsten Brendgen Date: Tue, 21 Apr 2026 12:25:33 +0200 Subject: [PATCH] adding samples --- .gitignore | 2 + sample/Deployment.psd1 | 111 +++++++++++++++++++++++++++++ sample/Template.psd1 | 157 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 270 insertions(+) create mode 100644 .gitignore create mode 100644 sample/Deployment.psd1 create mode 100644 sample/Template.psd1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..552c980 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.git +.sample \ No newline at end of file diff --git a/sample/Deployment.psd1 b/sample/Deployment.psd1 new file mode 100644 index 0000000..3c65743 --- /dev/null +++ b/sample/Deployment.psd1 @@ -0,0 +1,111 @@ +@{ + Templates = @( + @{ + TemplateName = "HZD Template" + TemplatePath = "./Configurations/HZD.psd1" + }, + @{ + TemplateName = "SQL Server Template" + TemplatePath = "./Configurations/Services/Template-SQLServer.psd1" + }, + @{ + TemplateName = "Umgebungs Template" + TemplatePath = "./Configurations/Umgebungen/Template-Test.psd1" + } + ) + + AllNodes = @( + @{ + NodeName = "JURZMAZSSQL901" + } + ) + + NonNodeData =@{ + Services = @{ + SQLServer = @{ + Instances = @( + @{ + Name = 'MSSQLSERVER' + + ServiceAccounts = @{ + SQLEngineAccount = @{ + ServiceAccountName = "gmsaE2Af901" + AccountType = "Group" + Path = "OU=DBA,OU=Dienste_Verfahren,OU=Administration,DC=justiz,DC=hessen,DC=de" + ManagedPasswordPrincipals = @( + @{ + GroupName = "sicE2AfE2ADB901" + Path = "OU=DBA,OU=Dienste_Verfahren,OU=Administration,DC=justiz,DC=hessen,DC=de" + } + ) + } + SQLAgentAccount = @{ + ServiceAccountName = "gmsaE2Aa901" + AccountType = "Group" + Path = "OU=DBA,OU=Dienste_Verfahren,OU=Administration,DC=justiz,DC=hessen,DC=de" + ManagedPasswordPrincipals = @( + @{ + GroupName = "sicE2AfE2ADB901" + Path = "OU=DBA,OU=Dienste_Verfahren,OU=Administration,DC=justiz,DC=hessen,DC=de" + } + ) + } + } + AlwaysOn = @{ + StartIndex = "B" + AlwaysOnGroups = @( + @{ + Name = "TestAG" + FailoverMode ="Automatic" + SeedingMode = "Automatic" + Listener = @{ + Provision = $true + IpAddress = "'10.96.x.x/255.255.255.0','10.96.x.x/255.255.255.0'" + Port = 1433 + } + + } + ) + } + + ConfigurationOptions= @() + + AdditionalScripts = @() + }, + @{ + Name = 'MSSQLSERVERTEST' + + ServiceAccounts = @{ + SQLEngineAccount = @{ + ServiceAccountName = "gmsaE2Af901" + AccountType = "Group" + Path = "OU=DBA,OU=Dienste_Verfahren,OU=Administration,DC=justiz,DC=hessen,DC=de" + ManagedPasswordPrincipals = @( + @{ + GroupName = "sicE2AfE2ADB901" + Path = "OU=DBA,OU=Dienste_Verfahren,OU=Administration,DC=justiz,DC=hessen,DC=de" + } + ) + } + SQLAgentAccount = @{ + ServiceAccountName = "gmsaE2Aa901" + AccountType = "Group" + Path = "OU=DBA,OU=Dienste_Verfahren,OU=Administration,DC=justiz,DC=hessen,DC=de" + ManagedPasswordPrincipals = @( + @{ + GroupName = "sicE2AfE2ADB901" + Path = "OU=DBA,OU=Dienste_Verfahren,OU=Administration,DC=justiz,DC=hessen,DC=de" + } + ) + } + } + + ConfigurationOptions= @() + + AdditionalScripts = @() + } + ) + } + } + } +} \ No newline at end of file diff --git a/sample/Template.psd1 b/sample/Template.psd1 new file mode 100644 index 0000000..938a3be --- /dev/null +++ b/sample/Template.psd1 @@ -0,0 +1,157 @@ +@{ + NonNodeData =@{ + Services = @{ + SQLServer = @{ + General = @{ + Version = "" + Release = "2022" + SourcePath = "\\JURZMAZSFIL02.justiz.hessen.de\DbaDSCSources\Binaries" + DestinationPath = "C:\HZD\SQL_Install" + } + Basic = @{ + Registry = @( + @{ + Key = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" + ValueName = "DisableLoopbackCheck" + ValueData = 1 + ValueType = "Dword" + }, + @{ + Ensure = "Present" + Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL16.MSSQLSERVER\SQLServerAgent" + ValueName = "MsxEncryptChannelOptions" + ValueData = 1 + ValueType = "Dword" + } + + @{ + Ensure = 'Present' + Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL16.MSSQLSERVER\SQLServerAgent' + ValueName = 'ErrorLogFile' + ValueData = 'D:\MSSQL16.MSSQLSERVER\MSSQL\Log\SQLAGENT.OUT' + ValueType = 'String' + }, + @{ + Ensure = 'Present' + Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL16.MSSQLSERVER\SQLServerAgent' + ValueName = 'WorkingDirectory' + ValueData = 'D:\MSSQL16.MSSQLSERVER\MSSQL\JOBS' + ValueType = 'String' + } + ) + WindowsFeatures = @( + @{ + Name = "RSAT-AD-PowerShell" + } + ) + Modules = @( + @{ + Name = "SQLServer" + AllowClobber = $true + } + ) + } + Instances = @( + @{ + Name = '*' + Features = 'SQLENGINE,FULLTEXT' + SQLSysAdminAccounts = 'sicDBServer_ServerAdmins' + Directories = @{ + InstallSharedDir = 'D:\Microsoft SQL Server' + InstallSharedWOWDir = 'D:\Microsoft SQL Server (x86)' + InstanceDir = 'D:\Microsoft SQL Server' + InstallSQLDataDir = 'D:' + SQLSysAdminAccounts = 'sicDBServer_ServerAdmins' + SQLBackupDir = '\\JURZMAZSFIL02.justiz.hessen.de\DbaDSCSources\Backups' + SQLUserDBDir = '' + SQLUserDBLogDir = '' + SQLTempDBDir = '' + SQLTempDBLogDir = '' + } + + Drives = @{ + } + + MountPoints = @{ + } + + Memory = @{ + UseDynamic = $true + minValue = 1024 + maxValue = 8192 + } + + ServiceAccounts = @{ + } + + AlwaysOn = @{ + } + + ConfigurationOptions= @( + @{ + OptionName = 'show advanced options' + OptionValue = '1' + }, + @{ + OptionName = 'cost threshold for parallelism' + OptionValue = '50' + }, + @{ + OptionName = 'blocked process threshold (s)' + OptionValue = '30' + }, + @{ + OptionName = 'backup compression default' + OptionValue = '1' + } + + ) + + AdditionalScripts = @( + + @{ + ScriptName = 'AdminDB' + ScriptPath = '\\JURZMAZSFIL02.justiz.hessen.de\DbaDSCSources\SQL_Scripts\AdminDB' + DependsOn = '[SqlSetup]Instance-MSSQLSERVER' + }, + + @{ + ScriptName = 'RenameSA' + ScriptPath = '\\JURZMAZSFIL02.justiz.hessen.de\DbaDSCSources\SQL_Scripts\RenameSA' + DependsOn = '[SqlScript]AdminDB' + + }, + @{ + ScriptName = 'Maintenance_Solution' + ScriptPath = '\\JURZMAZSFIL02.justiz.hessen.de\DbaDSCSources\SQL_Scripts\Maintenance_Solutions' + DependsOn = '[SqlScript]RenameSA' + }, + + @{ + ScriptName = 'WhoIsActive' + ScriptPath = '\\JURZMAZSFIL02.justiz.hessen.de\DbaDSCSources\SQL_Scripts\WhoIsActive_Monitoring' + DependsOn = '[SqlScript]Maintenance_Solution' + }, + + + @{ + ScriptName = 'Alerts' + ScriptPath = '\\JURZMAZSFIL02.justiz.hessen.de\DbaDSCSources\SQL_Scripts\Alerts_Email' + DependsOn = '[SqlScript]WhoIsActive' + }, + + + @{ + ScriptName = 'TempDB' + ScriptPath = '\\JURZMAZSFIL02.justiz.hessen.de\DbaDSCSources\SQL_Scripts\TempDB_Size' + DependsOn = '[SqlScript]Alerts' + + } + + ) + } + ) + } + } + } +} \ No newline at end of file