Skip to content

Instantly share code, notes, and snippets.

View apapiccio's full-sized avatar

Angelo Papiccio apapiccio

View GitHub Profile
@apapiccio
apapiccio / Update-DGPermissions.ps1
Last active September 25, 2017 08:24
Update ManagedBy Attribute for Distribution Groups
<#
.NOTES
===========================================================================
Created on: 22/09/2017 10:58 AM
Created by: papicc0a
Organization: RAC of WA
Filename: Update-DGPermissions.ps1
===========================================================================
.DESCRIPTION
This script is used to update the Managed By Attribute (aka Owners field) on Distribution Groups. Exchange 2007 only allowed for a single
<#
.NOTES
===========================================================================
Created on: 28/03/2017 4:22 PM
Created by: Angelo Papiccio
Organization: Papiccio.com
Filename: Create-AESPasswordFiles.ps1
===========================================================================
.DESCRIPTION
This function can be used to create both an AES encryption key file and password file that can be used
@apapiccio
apapiccio / gist:2af1f8a1a3a85f65ddc1bb4a6dcf0226
Created March 30, 2017 00:19
Storing Passwords Securely for PowerShell Scripts
# Create a 32 bit random key to be used by the AES Key
$AESKey = New-Object Byte[] 32
[Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($AESKey)
#Collect the location to store the AES Key file
$AESKeyFilePath = Read-Host -Prompt "Please enter the full path and file name for the AES Key (e.g. C:\AESKey.txt)"
Set-Content $AESKeyFilePath $AESKey #It will over-write existing file data if already exists