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 | |
Returns the SSL thumbprint for the certificate of the website | |
.DESCRIPTION | |
The certificate's thumbprint is a hash of the certificate's properties and keys. It is, in theory, a globally unique identifier. | |
.OUTPUTS | |
System.String | |
Get-WebSiteCertificateThumbprint returns a string with the certificate's 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
$thumbprintsToSearchFor = @( | |
"aabbccddeeffgg" | |
) | |
$OUs = @( | |
"OU=Servers,DC=contoso,DC=com", | |
"OU=OtherServers,DC=contoso,DC=com" | |
) | |
$logonHistoryDays = 90 |
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
New-TransportRule -Name "Encrypt mail with [encrypt] in subject" ` | |
-RuleErrorAction Defer ` | |
-SubjectMatchesPatterns '(?:^|\W|\w)\[encrypt\](?:$|\W|\w)' | |
-SetAuditSeverity Low ` | |
-ApplyOME $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
New-TransportRule -Name "Encrypt mail to Woodgrove Bank" ` | |
-RuleErrorAction Defer ` | |
-RecipientAddressMatchesPatterns '^[A-Z0-9._%+-][email protected]$' | |
-SetAuditSeverity Low ` | |
-ApplyOME $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
New-TransportRule -Name "Encrypt mail marked as Private or Confidential" ` | |
-RuleErrorAction Defer ` | |
-HeaderMatchesMessageHeader "Sensitivity"` | |
-HeaderMatchesPatterns "Private","Company-Confidential" ` | |
-SetAuditSeverity Low ` | |
-ApplyOME $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
New-TransportRule -Name "Encrypt mail from the Security team" ` | |
-RuleErrorAction Defer ` | |
-FromMemberOf '[email protected]' ` | |
-SetAuditSeverity Low ` | |
-ApplyOME $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
function AddOrUpdateTextInFile() { | |
Param( | |
$File, | |
[string]$StartString, | |
[string]$EndString, | |
[string]$ReplacementString | |
) | |
$fileContent = Get-Content $File -ReadCount 512 | |
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-RandomNumber ([int]$min,[int]$max,[switch]$leadingZeroes) { | |
$number = Get-Random -Minimum $min -Maximum $max | |
if ($leadingZeroes) { | |
if ($number.ToString().Length -lt $max.ToString().Length) { | |
$number.Tostring().PadLeft($max.ToString().Length,"0") | |
} else { | |
$number.ToString() | |
} | |
} else { | |
$number.ToString() |
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
'====================================================================== | |
' ListAllSMTPAddresses.vbs | |
'====================================================================== | |
' Author: Chris Brown ([email protected]) | |
' Date: 07/10/2014 | |
' Details: Returns all SMTP proxy addresses for all users in a given | |
' domain or OU in CSV format | |
' Source: Unknown (I forget if I wrote this myself or found it somewhere) | |
' | |
' |
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
'====================================================================== | |
' GetDistributionGroups.vbs | |
'====================================================================== | |
' Author: Chris Brown ([email protected]) | |
' Date: 09/10/2014 | |
' Details: Returns all mail-enabled groups in the domain | |
' Source: Unknown (I forget if I wrote this myself or found it somewhere) | |
'====================================================================== | |
' Everything below this will be searched. Must be in the format |