Skip to content

Instantly share code, notes, and snippets.

View scotgabriel's full-sized avatar

Scot Gabriel scotgabriel

View GitHub Profile
@scotgabriel
scotgabriel / FailedLogons.ps1
Last active May 2, 2018 21:50
Get Eventlog Entries from Forwarded Events log
# Powershell to get last 2 collected entries from Forwarded Events log having ID of 4625 (failed logon)
get-winevent -filterhashtable @{logname = 'ForwardedEvents'; id = 4625} -maxevents 2 | format-table -wrap -autosize
@scotgabriel
scotgabriel / Powershell-Exchange.md
Last active April 4, 2021 15:35
Powershell commands to interact with Microsoft Exchange

Powershell Commands to Interact with Microsoft Exchange

Connect, via Powershell, to Exchange Server remotely

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://server.domain.dom/PowerShell/ -Authentication Kerberos
import-pssession $session

Add Exchange Module

must already have Exchange Management Console installed

@scotgabriel
scotgabriel / Windows-Access-Special-Folders-From-Shell.md
Last active September 15, 2023 00:27
How to access Windows Special Folders using Shell Commands

Since Windows Vista, the list of available shell shortcuts can be found here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\

Command Win 10 Win 8 Win 7 Vista XP
shell:AccountPictures x x - - -
shell:Roaming Tiles x x - - -
shell:Common Programs x x x x x
@scotgabriel
scotgabriel / Windows command line gui access.md
Last active November 11, 2023 14:53
Common windows functions via rundll user32 and control panel

Rundll32 commands

OS: Windows 10/8/7

Add/Remove Programs

  • RunDll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,0

Content Advisor

  • RunDll32.exe msrating.dll,RatingSetupUI

Control Panel