Last active
December 19, 2015 11:09
-
-
Save JamesDawson/5945275 to your computer and use it in GitHub Desktop.
A simple PowerShell Desired State Configuration script (accompanies this blog post: )
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 SimpleConfig | |
| { | |
| node LAB-WEB01 | |
| { | |
| File MarkerFile | |
| { | |
| DestinationPath = 'C:\deployed.txt' | |
| Contents = "" | |
| Requires = "[Group]FooGroup","[Registry]EnableRdp" | |
| } | |
| Group FooGroup | |
| { | |
| Ensure = "Present" | |
| Name = "Foo" | |
| Members = @("foobar") | |
| Requires = "[User]FooBarUser" | |
| } | |
| User FooBarUser | |
| { | |
| Ensure = "Present" | |
| UserName = "foobar" | |
| Description = "an important service account" | |
| FullName = "FooBar Service Account" | |
| Disabled = $False | |
| Password = New-Object System.Management.Automation.PSCredential ("username", (ConvertTo-SecureString "P4ssw0rd1" -AsPlainText -Force)) | |
| PasswordNeverExpires = $True | |
| } | |
| Registry EnableRdp | |
| { | |
| Key = "HKLM:SYSTEM\CurrentControlSet\Control\Terminal Server"; | |
| ValueName = "fDenyTSConnections"; | |
| ValueData = "0"; | |
| ValueType = "DWord"; | |
| } | |
| } | |
| } | |
| SimpleConfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment