Skip to content

Instantly share code, notes, and snippets.

View BrandonStiff's full-sized avatar

Brandon Stiff BrandonStiff

View GitHub Profile
@BrandonStiff
BrandonStiff / Export-PSCredential.ps1
Last active April 19, 2017 02:25
Export A PowerShell Credential
function Export-PSCredential
{
<#
.SYNOPSIS
Exports a credential object into an XML file or registry value with an encrypted password. An important note is that the encrypted password can ONLY be read by the user who created the exported file
unless a passphrase is provided.
.PARAMETER Credential
Specifies the Credential to export to a file. Use Get-Credential to supply this.
@BrandonStiff
BrandonStiff / Get-EncryptionKey.ps1
Created April 18, 2017 03:12
Get Encryption Key
function Get-EncryptionKey()
{
<#
.SYNOPSIS
Retrieves a 128/192/256-bit encryption key using the given keyphrase.
.PARAMETER KeyPhrase
Specifies the phrase to use to create the 128-bit key.
.PARAMETER Length
@BrandonStiff
BrandonStiff / Invoke-WindowsActivation.ps1
Last active May 1, 2017 16:06
Activate a Windows Host by Proxy
function Invoke-WindowsActivation()
{
<#
.SYNOPSIS
This function reaches out remotely to the specified VAMT server and activates the given machines by proxy. To run this, you must meet the following requirements:
* The ActiveDirectory module from Microsoft be installed on the machine this function runs from. Install with:
Add-WindowsFeature
* It's assumed the machines you are dealing with are on an Active Directory domain.