Skip to content

Instantly share code, notes, and snippets.

View RamblingCookieMonster's full-sized avatar

Warren Frame RamblingCookieMonster

View GitHub Profile
@RamblingCookieMonster
RamblingCookieMonster / Migrate-ADMTUserCLI.ps1
Last active October 23, 2023 18:06
This is an example function that wraps ADMT.exe, abstracting out migration of Active Directory users into a PowerShell function.
<#
This is a PowerShell function wrapping the ADMT executable to abstract out migrating Active Directory users.
Read all the ADMT docs, and all the code and comments below before considering using this : )
The COM object was covered nicely by Jan Egil Ring:
http://blog.powershell.no/2010/08/04/automate-active-directory-migration-tool-using-windows-powershell/
Unfortunately, the COM object does not support Include files, a critical requirement for us.
@RamblingCookieMonster
RamblingCookieMonster / Get-WinEventData and Sysmon.ps1
Last active October 29, 2022 14:28
Extract detailed data from Sysmon event logs
# Download and dot source Get-WinEventData
# https://gallery.technet.microsoft.com/scriptcenter/Get-WinEventData-Extract-344ad840
. "\\path\to\Get-WinEventData.ps1"
# Download and Set up Sysmon as desired
# http://technet.microsoft.com/en-us/sysinternals/dn798348
# http://www.darkoperator.com/blog/2014/8/8/sysinternals-sysmon
#Use Get-WinEvent and Get-WinEventData to obtain events and extract XML data from them - let's see all the properties behind one!
Get-WinEvent -FilterHashtable @{logname="Microsoft-Windows-Sysmon/Operational";id=3} |
@RamblingCookieMonster
RamblingCookieMonster / Examples.ps1
Created August 16, 2014 23:38
Quick and dirty PowerShell Tricks
# A few handy tricks I use on a daily basis, from various sources
# Running with UAC and already elevated? No prompts if you call things from here : )
New-Alias -name hyperv -Value "$env:windir\system32\virtmgmt.msc"
New-Alias -name vsphere -value "C:\Program Files (x86)\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient.exe"
New-Alias -Name n -Value "C:\Tools\NotePad2\notepad2.exe"
New-Alias -name RSAT -Value "C:\Tools\Custom.msc"
#...
@RamblingCookieMonster
RamblingCookieMonster / Get-Secret.ps1
Last active October 6, 2017 17:57
Fun with Thycotic Secret Server
<#
Picked up a trial for Thycotic Secret Server.
Very impressed so far. Simple setup, had a quick and dirty Get-Secret function a few minutes later.
All code here assumes you have configured IIS and Secret Server to allow Windows Authentication, and have enabled web services.
This is quick and dirty, i.e. we don't handle errors, we don't handle varying environments, etc.
@RamblingCookieMonster
RamblingCookieMonster / PowerShellUserGroups.md
Last active November 13, 2016 05:05
PowerShell User Groups Example List

What is this?

A simple example illustrating how to collect a centralized list of PowerShell user groups

Why?

Keith asked if there were a list of PowerShell user groups. There is not.

What about...

@RamblingCookieMonster
RamblingCookieMonster / OpenSource.PowerShell.ReleasePipeline.Projects.md
Last active June 26, 2016 22:47
OpenSource.PowerShell.ReleasePipeline.Projects.md
@RamblingCookieMonster
RamblingCookieMonster / Question.md
Last active June 25, 2016 21:16
Would Tracking PowerShell Sessions be Helpful?

Hi all!

TLDR: Would it be helpful to track PowerShell-related sessions at non-PowerShell events, rather than just tracking PowerShell-related events?

Longer story:

So! Personally, I've found that sessions covering $OtherTechnology through PowerShell fairly helpful.

Folks presenting on how to automate and configure SQL Server, VMware, Azure, Active Directory, and the many other technologies PowerShell can interface with tend to be good folks to learn from.

@RamblingCookieMonster
RamblingCookieMonster / rabbitmq.config
Created July 3, 2015 14:46
zRabbitMq.rabbitmq.config
%% -*- mode: erlang -*-
%% ----------------------------------------------------------------------------
%% See http://www.rabbitmq.com/configure.html for details.
%% ----------------------------------------------------------------------------
[
{rabbit,
[%%
%% Network Connectivity
%% ====================
%%
@RamblingCookieMonster
RamblingCookieMonster / PSExcel.HighlightLine.ps1
Last active August 29, 2015 14:24
PSExcel.HighlightLine.ps1
<#
This code illustrates highlighting a line based on a cell value
Search-CellValue will help identify the rows we care about
Format-Cell will format these rows
Prerequisite: Download and load up PSExcel http://ramblingcookiemonster.github.io/PSExcel-Intro/
#>
# View the help on the primary commands we will be using
Get-Help Search-CellValue -Full
@RamblingCookieMonster
RamblingCookieMonster / Get-EnumValues.ps1
Last active August 29, 2015 14:18
Get-EnumValues.ps1
function Get-EnumValues {
<#
.SYNOPSIS
Return list of names and values for an enumeration object
.DESCRIPTION
Return list of names and values for an enumeration object
.PARAMETER Type
Pass in an actual type, or a string for the type name.