Skip to content

Instantly share code, notes, and snippets.


Shannon Graybrook realslacker

View GitHub Profile
realslacker / Invoke-GPOScriptReport.ps1
Created May 20, 2019
Get all Group Policy Objects with scripts
View Invoke-GPOScriptReport.ps1
Import-Module GroupPolicy -ErrorAction Stop
Get-GPO -All |
ForEach-Object { Write-Host ( 'Processing GPO ''{0}''...' -f $_.DisplayName ); $_ } -pv 'GPO' |
Get-GPOReport -ReportType Xml |
ForEach-Object { [xml]$_ } |
foreach-Object {
$_.GPO.User.ExtensionData |
Where-Object { $_.Name -eq 'Scripts' } |
realslacker / mRemoteNG-Password-Util.psm1
Last active Nov 15, 2020
Work with mRemoteNG passwords... Functionality has been rolled into
View mRemoteNG-Password-Util.psm1
Add-Type -Path 'C:\Program Files (x86)\mRemoteNG\BouncyCastle.Crypto.dll'
function ConvertFrom-MRNGSecurePassword {
realslacker / WmiNameSpaceSecurity.psm1
Created Apr 16, 2019
A module with expanded functionality base on original work by Steve Lee and Graeme Bray. See Set-WMINameSpaceSecurity.ps1 for original.
View WmiNameSpaceSecurity.psm1
This module is provided AS IS without warranty of any kind. This work is based off work by
other talented individuals, and should not be considered an original work.
Modified into module by Shannon Graybrook
Modified by Graeme Bray
Original Content by Steve Lee
View wmi_filters.ps1
# filter for server core
$Query = 'SELECT * FROM Win32_OptionalFeature WHERE Caption = "Microsoft-Windows-Server-Gui-Shell-Package-DisplayName" AND InstallState = "2"'
Get-WmiObject -Query $Query
realslacker / Restart-ComputerWhen.ps1
Created Feb 22, 2019
Schedule a restart at a specific time
View Restart-ComputerWhen.ps1
# the same script as a one liner:
# shutdown -r -t ( [math]::Ceiling( ([datetime]"1PM").Subtract((Get-Date)).TotalSeconds )
$Now = Get-Date
realslacker / PowerShell Menu Fixes.reg
Created Jan 12, 2019
Changes PowerShell right click menu items so that it (1) doesn't try to change the execution policy and (2) add's run as and run as user options for scripts.
View PowerShell Menu Fixes.reg
Windows Registry Editor Version 5.00
View webserver cert-req.cmd
SET mytime=%time: =0%
SET dtstamp=%date:~-4%%date:~4,2%%date:~7,2%%mytime:~0,2%%time:~3,2%%time:~6,2%
notepad %TEMP%\cert_%dtstamp%.req
certreq -submit -attrib "CertificateTemplate:WebServer10Y" %TEMP%\cert_%dtstamp%.req %TEMP%\cert_%dtstamp%.cer
notepad %TEMP%\cert_%dtstamp%.cer
SET /P answer=Save the generated certificate? (y/N)
realslacker / clear icon cache.cmd
Created Oct 31, 2018
Clear the icon cache to fix Windows 10 start menu icons
View clear icon cache.cmd
ie4uinit.exe -ClearIconCache
taskkill /IM explorer.exe /F
DEL "%localappdata%\IconCache.db" /A
realslacker / Reset-OutlookProfile.ps1
Last active Oct 31, 2018
This script will remove all present outlook profiles and associated files, allowing an out-of-box experience.
View Reset-OutlookProfile.ps1
[CmdletBinding(SupportsShouldProcess, ConfirmImpact='High')]
$NewProfileName = 'Outlook'
Add-Type -AssemblyName PresentationFramework -Verbose:$false
View Add-SignatureToScript.ps1
Signs a PS1 script with the local users code signing certificate.
Takes a PS1 file as an argument and signs with the local user's code signing certificate.
Optionally allows specification of a timestamp server.
A PS1 file to sign. Accepts pipeline input.
.PARAMETER TimestampServer
An optional parameter specifying a timestamp server. The default is ''.