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
Import-Module ActiveDirectory | |
$MeGroups = Get-ADGroup -Filter {Mail -like "*"} -Properties Mail,Members,msExchHideFromAddressLists | Where-Object {$_.msExchHideFromAddressLists -ne $true} | |
Write-Host "There are" $MeGroups.Count "mail enabled groups (Security & Distribution)" | |
ForEach ($Group in $MeGroups) { | |
$GroupDN = $Group.DistinguishedName | |
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
#----------------------------------------------------# | |
# Decrypts password using Certificate | |
#----------------------------------------------------# | |
function Get-DecryptedPassword | |
{ | |
[CmdletBinding()] | |
param | |
( | |
$EncryptedPassword, | |
$EncryptedKey, |
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 AzCopy_PSTs { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true)] | |
[string]$Environment, | |
[Parameter(Mandatory=$false)] | |
[string]$IndividualUserName, | |
[Parameter(Mandatory=$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 Show-PowerShell() { | |
$null = $showWindowAsync::ShowWindowAsync((Get-Process –id $pid).MainWindowHandle, 10) | |
} | |
function Hide-PowerShell() { | |
$null = $showWindowAsync::ShowWindowAsync((Get-Process –id $pid).MainWindowHandle, 2) | |
} | |
$script:showWindowAsync = Add-Type –memberDefinition @” | |
[DllImport("user32.dll")] |
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
[CmdletBinding()] | |
param | |
( | |
[string]$DNSServer = "8.8.8.8", | |
[string]$DomainName = "domain.com", | |
[parameter(Mandatory=$true)] | |
[AllowNull()] | |
[AllowEmptyString()] |