This file contains 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 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 | |
Converts files to the given encoding. | |
Matches the include pattern recursively under the given path. | |
.EXAMPLE | |
Convert-FileEncoding -Include *.js -Path scripts -Encoding UTF8 | |
#> | |
function Convert-FileEncoding([string]$Include, [string]$Path, [string]$Encoding='UTF8') { | |
$count = 0 |
This file contains 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 | |
A custom command channel to generate emails from Office 365 Alert Context data | |
.DESCRIPTION | |
This script is used as a command channel to generate alert emails from the data | |
stored in the Alert Context tab of the Office 365 Message Center alerts. There | |
is no simple way to retrieve this data as that tab is more or less free form, | |
so the data is pulled from SCOM, filtered for New resolution state and then | |
send to the lsit of email addresses. | |
.PARAMETER SmtpHost |
This file contains 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
param | |
( | |
$strFileName = "C:scriptsfile.xlsx", | |
$strSheetName = 'Out' | |
) | |
if (!(($strSheetName.Substring($strSheetName.Length-1,1)) -eq '$')) | |
{ | |
$strSheetName = "$($strSheetName)`$" | |
} | |
$strProvider = "Provider=Microsoft.ACE.OLEDB.12.0" |
This file contains 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
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server"; | |
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server"; | |
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client"; | |
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server"; | |
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client"; | |
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server"; | |
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client"; | |
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server"; | |
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client"; | |
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\ |
This file contains 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
param | |
( | |
$StartDate = (Get-Date), | |
$EndDate = (Get-Date) | |
) | |
try | |
{ | |
$ErrorActionPreference = 'Stop'; | |
$Error.Clear(); |
This file contains 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
import-module 'C:\Program Files\Microsoft Security Client\MpProvider\MpProvider.psd1' | |
get-mprotcomputerstatus |
This file contains 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 New-Password | |
{ | |
<# | |
.SYNOPSIS | |
Create a new password | |
.DESCRIPTION | |
This function creates a password using the cryptographic Random Number Generator see the | |
MSDN link for more details. | |
.PARAMETER Length | |
An integer that defines how long the password should be |
This file contains 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 New-WordTable { | |
[cmdletbinding( | |
DefaultParameterSetName='Table' | |
)] | |
Param ( | |
[parameter()] | |
[object]$WordObject, | |
[parameter()] | |
[object]$Object, | |
[parameter()] |
This file contains 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 New-XmlDocument | |
{ | |
[CmdletBinding()] | |
Param | |
( | |
[string]$Root, | |
[string[]]$Elements | |
) | |
Begin | |
{ |