Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
DSC Push model Sample for AD Memeber (DSC Sever) to WorkGroup Servers (30 servers). Speed comparison with DSC and Valentia.
# DSC Push のサンプルとして、サーバー30台に対する DSC-Service のWindows 機能インストールを行う
configuration InstallDSCServiceCredential
{
param
(
[PSCredential]
$credential
)
node $AllNodes.NodeName
{
WindowsFeature DSCService
{
Name = "DSC-Service"
Ensure = "Present"
}
}
}
$computers = Show-ValentiaGroup | where Name -eq "30Servers.ps1" | target
$nodeName = $computers | %{@{NodeName = $_}}
$ConfigurationData = @{
AllNodes = @(
@{
NodeName = "*"
PSDscAllowPlainTextPassword = $true
}
$nodeName
)
}
$credential = Get-ValentiaCredential
$cimSession = New-CimSession -Authentication Negotiate -Credential $credential -ComputerName $computers
$dsc = InstallDSCServiceCredential -output "." -ConfigurationData $ConfigurationData -credential $credential
Start-DscConfiguration -cimSession $cimSession -Wait -Force -Verbose -Path ($dsc.Directory.FullName | select -First 1)
# DSC Push との比較として、 PowerShell Deployment Library の valentia で 、別の30台サーバー群に対して、Runspace による非同期実行
# valentia : https://github.com/guitarrapc/valentia
valea 30ServersPart2.ps1 {Install-WindowsFeature -Name DSC-Service}
<#
30 台に対する DSC Serviceのインストール
valentia の valea : 79.3602306sec
DSC の push : 103.551sec
#>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.