Skip to content

Instantly share code, notes, and snippets.

Mathias R. Jessen IISResetMe

  • Netherlands
Block or report user

Report or block IISResetMe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Update-ADPassword.ps1
function Update-ADPassword
[string]$Domain = $env:USERDOMAIN
try {
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$ctx = [System.DirectoryServices.AccountManagement.PrincipalContext]::new('Domain', $Domain)
$acc = [System.DirectoryServices.AccountManagement.UserPrincipal]::FindByIdentity($ctx, ($currCred = Get-Credential -Message 'Input your current credentials').UserName)
View Test-PSCache.ps1
Import-Module PSCache
# Define fetcher
$Fetcher = {
# Emulate a potentially slow operation
Start-Sleep -Milliseconds (Get-Random -Minimum 15 -Maximum 30)
# Return an object corresponding to $_
ID = $_
IISResetMe / Get-AuditPolicy.ps1
Last active Sep 10, 2019
Poor man's audit policy parser
View Get-AuditPolicy.ps1
#Requires -Version 5
# Define AuditSetting enum
enum AuditSetting {
None = 0
Success = 1
Failure = 2
All = 3
View braincandy_20190831.ps1
1..9|%{"{0,9} x 8 + $_ = $(8*($a=1..$_-join'')+$_)"-f$a}
from itertools import product
def expand_alphabet(alphabet, max_width):
for width in range(1, max_width+1):
for combo in product(alphabet, repeat=width):
def main():
expand_alphabet(['a', 'b', 'c'], 4)
IISResetMe / Test-NullPerformance.ps1
Last active Aug 29, 2019
Output suppression and the pipeline
View Test-NullPerformance.ps1
Performance test for output suppression in PowerShell
Very basic performance test against different types of output suppression in PowerShell
Increase the value of the Iterations parameter to observe how performance impacts the different methods
View EventForwardingPluginIssues_subscription.xml
<Subscription xmlns="">
<Description>Operational events from the EventLog-ForwardingPlugin log on clients, used for troubleshooting</Description>
<Query Id="0" Path="Microsoft-Windows-Forwarding/Operational">
View Microsoft.PowerShell_profile.ps1
$function:prompt = {
return "PS $($executionContext.SessionState.Path.CurrentLocation -replace [regex]::Escape($HOME.Trim('\')),'~')$('>' * ($nestedPromptLevel + 1)) "
IISResetMe / BigIntRange.class.ps1
Created Aug 13, 2019
Lazy range generator for `[bigint]`
View BigIntRange.class.ps1
class BigIntRange : System.Collections.IEnumerable
$this.from = $from
from ctypes import windll,c_ushort,byref
import platform
def is_syswow64_process():
if platform.architecture()[0] != "64bit":
# 32-bit OS, no syswow64 handling
return False
# Ok, 64-bit OS, let's see if the process is 32-bit
# Obtain process handle to self
You can’t perform that action at this time.