Skip to content

Instantly share code, notes, and snippets.

View karbomusic's full-sized avatar

Karbomusic karbomusic

View GitHub Profile
$domain = "mydomain"
$adminUsername = "someadmin"
$adminPassword = "password"
$targetAccount = "targetAccount"
$newPassword = "NewPassword123"
$path = "LDAP://$domain"
$searchAccount = "(sAMAccountName=$targetAccount)"
# Run via admin account
@karbomusic
karbomusic / EWSPushNoApi.ps1
Last active September 10, 2020 18:41
How to create a push subscription without any Exchange dependencies such as the Managed API.
# Creates a super simple EWS Push subscription with just an http request and XML
# Does nothing other than this to show it can be done minus the EWS API
$subscribeRequest = "<?xml version='1.0' encoding='utf-8'?>
<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:m='http://schemas.microsoft.com/exchange/services/2006/messages'
xmlns:t='http://schemas.microsoft.com/exchange/services/2006/types'
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
<soap:Header>
<t:RequestServerVersion Version='Exchange2010_SP1' />
@karbomusic
karbomusic / EWSStreamingNotificationsTool.ps1
Created September 10, 2020 18:37
Testing EWS Streaming Notifications
###########################################################
# Streaming Notifications Test
# Date: 4.26.18
# Requires EWS Managed API 2.2
# For Testing only, not fully vetted - could have issues.
# Defaults to inbox/newmailevent
###########################################################
param(
@karbomusic
karbomusic / EWSPushNotificationTool.ps1
Last active July 15, 2025 13:19
Test EWS Push Subscriptions on Exchange Server 2010-2019
# -------------------------------------------------------------------------------------
# EWS PUSH SUBSCRIPTION TOOL 1.0
# This sample script is not supported in any way and is
# provided AS IS without warranty of any kind.
# -------------------------------------------------------------------------------------
#
# INFO:
# The goal of this script is to test basic functionality of an EWS Push Notifications.
# There are no dependencies on EWS Managed API.
#
@karbomusic
karbomusic / dumpOnProcCreate.ps1
Last active August 5, 2021 18:13
Use WqlEventQuery to poll process creation, then procdump it on creation.
# Be aware of potential performance issues:
# https://docs.microsoft.com/en-us/archive/blogs/winsdk/accidental-denial-of-service-through-inefficient-program-design-part-1-watching-wmi-events-for-object-creation-e-g-win32_process
$processToWatch = "'noderunner.exe'"
# poll interval?
$timespan = [TimeSpan]::FromSeconds(1)
$whereClause = "TargetInstance ISA 'Win32_Process' and TargetInstance.Name = " + $processToWatch
$wlq = New-Object System.Management.WqlEventQuery("__InstanceCreationEvent", $timespan, $whereClause)