Last active
August 29, 2015 13:57
-
-
Save guitarrapc/9748680 to your computer and use it in GitHub Desktop.
DSC Push model Sample for AD Memeber (DSC Sever) to WorkGroup Servers (30 servers). Speed comparison with DSC and Valentia.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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