Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / Contact.ps1
Created August 28, 2018 20:10
PSSA Weird error. #1060
enum Departments {
Admin
Compta
Ventes
RetDev
DevLogiciel
DevMicro
DevMateriel
Operations
Production
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}
$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

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: