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 BasicWebServer | |
{ | |
param | |
( | |
[string]$ComputerName | |
) | |
Node $ComputerName | |
{ | |
WindowsFeature WebServerRole |
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 SetupDSCClient | |
{ | |
param | |
( | |
[string]$NodeId, | |
[string]$PullServer | |
) | |
LocalConfigurationManager | |
{ |
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 DSCPullServer | |
{ | |
param | |
( | |
[string]$ComputerName | |
) | |
Node $ComputerName | |
{ | |
WindowsFeature DSCService |
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
$SourcePath = "$($pshome)\modules\psdesiredstateconfiguration\pullserver" | |
$DestinationPath = "C:\inetpub\wwwroot\PSDSCPullServer" | |
$AppPool = "DSCAppPool" | |
New-Item C:\inetpub\wwwroot\PSDSCPullServer\bin -ItemType directory -Force | |
Copy-Item "$($SourcePath)\psdscpullserver.*" $DestinationPath | |
Copy-Item "$($SourcePath)\Global.asax" $DestinationPath | |
Copy-Item "$($SourcePath)\Microsoft.Powershell.DesiredStateConfiguration.Service.dll" "$($DestinationPath)\bin" | |
Rename-Item "$($DestinationPath)\psdscpullserver.config" "$($DestinationPath)\web.config" | |
Copy-Item "$($SourcePath)\Devices.mdb" "$($env:programfiles)\WindowsPowerShell\DscService" |
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 BasicWebServer | |
{ | |
param | |
( | |
[Parameter(Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
[string]$ComputerName, | |
[string]$Source = $null, | |
[Parameter(Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] |
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 Defaults2012R2 | |
{ | |
param | |
( | |
[Parameter(Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
[string]$ComputerName | |
) | |
Node $ComputerName | |
{ |
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
<# | |
.SYNOPSIS | |
Detect installed and not installed features to output a DSC file | |
.DESCRIPTION | |
This script will return a list of features that are installed and not installed | |
for the server you run it on. This can be viewed as a basic starting point in | |
getting DSC up and running for a given server. Once you have this information | |
you can use it to simply make sure this server always has these settings, or | |
add to it with more DSC Resources. | |
.EXAMPLE |
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
<# | |
Create FW rules for TCP and UDP Listening Ports | |
netstat -an -p tcp |Select-String "Listening" | |
netstat -an -p udp |Select-String "Listening" | |
for each entry in netstat create firewall rule | |
name = -p tcp|udp port port # | |
description = automatic allow rule generated by powershell on get-date |
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
public static T GetEdmundsContent<T>(string url) where T : new() | |
{ | |
using (var client = new WebClient()) | |
{ | |
var jsonData = string.Empty; | |
try | |
{ | |
Sleep(1000); | |
jsonData = client.DownloadString(url); | |
} |
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
<# | |
.SYNOPSIS | |
Template script | |
.DESCRIPTION | |
This script sets up the basic framework that I use for all my scripts. | |
.PARAMETER | |
.EXAMPLE | |
.NOTES | |
ScriptName : Copy-Delegations.ps1 | |
Created By : jspatton |
OlderNewer