Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am webtroter on github.
  • I am webtroter (https://keybase.io/webtroter) on keybase.
  • I have a public key whose fingerprint is BF85 3A27 82BC 2B69 16D9 A248 26F9 0983 9D2E 08DB

To claim this, I am signing this object:

$wshell = New-Object -ComObject Wscript.Shell
$wshell.Popup("Please enter in your Domain Admin credentials. Please remember it should be in the form of DOMAIN\username. The second & third prompt for your credentials, it will be for Office365. At that time, please use [email protected]",0,"Credentials Needed!",0x0)
$creds = Get-Credential
$PSDefaultParameterValues = @{"*-AD*:Credential"=$creds}
#CREATES AN EXCHANGE ONLINE SESSION
$UserCredential = Get-Credential
$ExchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
function LaunchO365Console
{
Start-Process -FilePath "https://outlook.office365.com/ecp/Reporting/MailboxSearches.aspx"
}
#function Get-DomainAdminInfo
$Creds = Get-Credential -Message "Enter username in DOMAIN\username format"
$PSDefaultParameterValues = @{"*-AD*:Credential"=$Creds}
@webtroter
webtroter / Contact.ps1
Created August 28, 2018 20:10
PSSA Weird error. #1060
enum Departments {
Admin
Compta
Ventes
RetDev
DevLogiciel
DevMicro
DevMateriel
Operations
Production
@webtroter
webtroter / Speak-CatFacts.ps1
Created February 26, 2019 20:14
PowerShell Prank
# WinRM needs to be enable:
# win qc
$Scriptblock = {
Add-Type -AssemblyName System.Speech
$SpeechSynth = New-Object System.Speech.Synthesis.SpeechSynthesizer
$CatFact = (ConvertFrom-Json (Invoke-WebRequest -Uri 'http://catfact.ninja/facts' -UseBasicParsing)).data.fact
$SpeechSynth.Speak("did you know?")
$SpeechSynth.Speak($CatFact)
}
@webtroter
webtroter / Rotate-UrgentDL.ps1
Created March 5, 2019 16:14
Rotate-UrgentDL.ps1
#requires -version 5
<#
.SYNOPSIS
Returns
.DESCRIPTION
<Brief description of script>
.PARAMETER
@webtroter
webtroter / SophosEndpointRemovalScript.ps1
Created August 1, 2019 01:18
Sophos Endpoint Removal Script
#Sophos Endpoint Removal Script
#Usage examples:
# .\removesophos.ps1 # Just logs all messages to screen and file.ss.é
# .\removesophos.ps1 -Remove YES # Removes all Sophos components and logs all messages to screen and file.
# .\removesophos.ps1 -Password 1234567 -Remove YES # Password will be provided to SEDCli.exe if TP is on and SEDCLi.exe exists.
# .\removesophos.ps1 -ErrorOnly YES # Only print items that exist (errors) on screen. Still logs all to file.
# .\removesophos.ps1 -Remove YES -Restart YES # At the end of the process restart the computer. 10 seconds delay by default intDelaySecondsRestart.
# .\removesophos.ps1 -NoLogFile YES # No log file will be created. Messages will still be output to screen. Will run quicker.
# .\removesophos.ps1 -Debug YES # Outputs a little more data to screen for debugging purposes. Not expected to be used in normal use.
@webtroter
webtroter / sync-seedbox.sh
Created August 9, 2021 20:28
Sync Seedbox
#!/bin/bash
# Variable Section
SERVER="[email protected]"
SRC=$SERVER":/media/sdf1/username/Completed"
DEST="/media/Share/"
LOGDIR="/var/log/sync-seedbox/"
LOGFILE="/var/log/sync-seedbox/rsync_`date +%Y%m%d-%Hh%M`.log"
LOCKDIR="/var/lock/"
LOCKFILE="/var/lock/`basename $0`.lock"
@webtroter
webtroter / Invoke-WireGuardRoutingHelper.ps1
Last active April 3, 2025 09:11
WireGuard Windows Routing Helper Script
[CmdletBinding(DefaultParameterSetName = "PreDown")]
param (
[Parameter(ParameterSetName = "Setup")]
[switch]
$Setup,
[Parameter(ParameterSetName = "Setup")]
[switch]
$RestartWGService,
# WireGuard Interface
[Parameter(Position = 0)]
@webtroter
webtroter / FillDisk.ps1
Created November 30, 2021 18:29
Fill Disk
function FillDisk {
param (
$FillLimit = 20MB
)
$remaining = (Get-Volume C | Select-Object -ExpandProperty SizeRemaining) - $FillLimit
$filename = "vss-block_{0}G.dummy" -f ([math]::Round($remaining/1GB, 2))
& fsutil file createnew $filename $([math]::Floor($remaining))
}