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
Function Export-MachineCert { | |
<# | |
.SYNOPSIS | |
Harvests a certificate from a remote system. | |
.DESCRIPTION | |
Invokes a command on a remote system to copy the certificate to the machine running the command. | |
.PARAMETER Computername | |
Specifies the name of the remote system to harvest the certificate. | |
.PARAMETER Path | |
Provides the path where the certificate is copied to on the host system. |
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
Configuration CredentialEncryptExample { | |
Param ( | |
[Parameter(Mandatory=$true)] | |
[PSCredential]$Credential | |
) | |
Node $AllNodes.NodeName | |
{ | |
Group TestGroup{ | |
GroupName = 'TestGroup' |
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
Configuration DSCLabUp { | |
param ( | |
[string[]]$NodeName, | |
[string]$MachineName | |
) | |
Import-DscResource -ModuleName xActiveDirectory | |
Import-DscResource –ModuleName xPSDesiredStateConfiguration | |
Import-DscResource -Module xNetworking |
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
$DNSArray = @('127.0.0.1') | |
$ConfigData = @{ | |
AllNodes = @( | |
@{ | |
Nodename = 'Localhost' | |
Role = "DomainController" | |
MachineName = 'ZDC01' | |
DomainName = "Zephyr.org" |
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
Configuration HTTPSPull { | |
param ( | |
[string[]]$NodeName, | |
[string]$MachineName, | |
[string]$IPAddress, | |
[string]$DefaultGateway, | |
[string[]]$DNSIPAddress, | |
[string]$DomaniName | |
) | |
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
Find-Module xPSDesiredStateConfiguration | Install-Module |
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
Invoke-Command -Computername zcert01 {Get-Childitem Cert:\LocalMachine\My | Where-Object {$_.FriendlyName -eq "PSDSCPullServerCert"} | Select-Object -ExpandProperty ThumbPrint} |
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
configuration HTTPSPullServer | |
{ | |
# Modules must exist on target pull server | |
Import-DSCResource -ModuleName xPSDesiredStateConfiguration -ModuleVersion 3.6.0.0 | |
Import-DSCResource -ModuleName PSDesiredStateConfiguration | |
Node ZPull01 | |
{ | |
WindowsFeature DSCServiceFeature | |
{ |
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
Start-Process -FilePath iexplore.exe https://zpull01.zephyr.org:8080/PSDSCPullServer.svc |
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
function Publish-DSCResourcePull { | |
Param( | |
[string[]] | |
$Module | |
) | |
foreach ($ModuleName in $Module){ | |
$ModuleVersion = (Get-Module $ModuleName -ListAvailable).Version | |