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
| <# | |
| Step 1 - (on a non-DC) | |
| Add-WindowsFeature RSAT-AD-PowerShell | |
| Step 2 - Create a Security group and add all the hostnames you will use the gMSA on. | |
| These are the computers permitted to retrieve the password from AD | |
| #> | |
| $gMSA_Name = 'svc_sql' | |
| $gMSA_FQDN = 'svc_sql.hall.test' |
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
| $labName = 'TestLab' | |
| $domain = 'test.lab' | |
| $adminAcct = 'Administrator' | |
| $adminPass = 'YourPasswordHere' | |
| $labsources = "D:\LabSources" | |
| #Create an empty lab template and define where the lab XML files and the VMs will be stored | |
| New-LabDefinition -Name $labName -DefaultVirtualizationEngine HyperV | |
| #Network definition |
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
| # Code Source: http://duffney.io/Configure-HTTPS-DSC-PullServerPSv5 | |
| $inf = @" | |
| [Version] | |
| Signature="`$Windows NT`$" | |
| [NewRequest] | |
| Subject = "CN=DC, OU=IT, O=Signalwarrant, L=Augusta, S=SE, C=US" | |
| KeySpec = 1 | |
| KeyLength = 2048 | |
| Exportable = TRUE |
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
| # 4. Configure the Pull Server | |
| Configuration DscPullServer | |
| { | |
| param | |
| ( | |
| [string[]]$NodeName = 'localhost', | |
| [ValidateNotNullOrEmpty()] | |
| [string] $certificateThumbPrint, |
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
| # 5. Create the client MOFs | |
| # https://github.com/PowerShell/AuditPolicyDsc | |
| Configuration AuditPolicyCsv { | |
| param( | |
| [String] $NodeName = 'SVR' | |
| ) | |
| Import-DscResource -ModuleName AuditPolicyDsc |
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
| # Run on the target node | |
| [DSCLocalConfigurationManager()] | |
| Configuration LCMConfig { | |
| Node SVR { | |
| Settings { | |
| ConfigurationMode = 'ApplyAndAutoCorrect' | |
| RefreshMode = 'Pull' | |
| } | |
| ConfigurationRepositoryWeb PullServer { |
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 ConvertTo-PDF { | |
| <# | |
| .DESCRIPTION | |
| Convert 1 or many files to PDFs | |
| .PARAMETER filePath | |
| -filePath: The path to the folder that contains all your text files | |
| .PARAMETER dllPath | |
| -dllPath: The Path to the iTextSharp.DLL file |
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
| { | |
| "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "adminUsername": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the administrator account of the new VM and domain" | |
| } | |
| }, |
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 Format-MerchReports { | |
| <# | |
| .SYNOPSIS | |
| Reformats and combines Merch by Amazon sales reports | |
| .DESCRIPTION | |
| 1. Deletes the first 13 rows of each CSV in $csvPath | |
| 2. Combines the data from all the files | |
| 3. Adds column headers defined in $finalHeader | |
| 4. Outputs the file to $csvPath as formatted-Merchreports.csv |
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 Get-LocalAdmins { | |
| <# | |
| .SYNOPSIS | |
| Gets the members of the local administrators of the computer | |
| and outputs the result to a CSV file. | |
| .PARAMETER Computers | |
| Specifies the Computer names of devices to query | |
| .INPUTS | |
| System.String. Get-LocalAdmins can accept a string value to | |
| determine the Computers parameter. |
OlderNewer