Skip to content

Instantly share code, notes, and snippets.

Avatar

Shannon Brooks realslacker

View GitHub Profile
@realslacker
realslacker / Regular Expressions.ps1
Created Dec 10, 2021
Useful Regular Expressions
View Regular Expressions.ps1
# Relative OU Path
$RelativeOU = '^(?:(?:CN|OU)=(?:(?<=\\),|[^,])+(?:,(?=(?:CN|OU)=(?:(?<=\\),|[^,])+)|$))+$'
# Full OU
$OU = '^(?:(?:CN|OU)=(?:(?<=\\),|[^,])+,)+(?:DC=(?:(?<=\\),|[^,])+(?:,(?=DC=(?:(?<=\\),|[^,])+)|$))+$'
@realslacker
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
explorer
@realslacker
realslacker / Nextcloud Icon Add.reg
Last active Aug 28, 2021
Add or remove Nextcloud/OwnCloud icon to Explorer file navigation (like Dropbox/OneDrive/G-Drive) for a shortcut to your Nextcloud folder.
View Nextcloud Icon Add.reg
Windows Registry Editor Version 5.00
; NOTE, this file uses a GUID generated here
; https://www.guidgenerator.com/online-guid-generator.aspx
; IF you are going to have multiple Nextcloud folders in your tree you
; will need to make a new GUID for each folder and find/replace the
; value "38d6662b-09f4-4e73-bf61-b0e512ec41e1" with your unique GUID
[HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\\{38d6662b-09f4-4e73-bf61-b0e512ec41e1}]
; Name of the folder, also see last line below
@realslacker
realslacker / Get-UniFiBackup.PS1
Last active Aug 28, 2021
Powershell Script to download backup from a Ubiquiti UniFi Controller or Cloud Key
View Get-UniFiBackup.PS1
<#
.NOTES
Author: Shannon Brooks
Date: Dec 1st, 2016
Licence: Creative Commons Attribution-ShareAlike 4.0 International License
License URL: http://creativecommons.org/licenses/by-sa/4.0/
.SYNOPSIS
View HOWTO Nextcloud SAML Login with AzureAD.md

Enable Nextcloud SAML Login using AzureAD

Create an Enterprise App for Nextcloud

  1. Open the Azure admin portal - https://portal.azure.com
  2. Open Azure Active Directory > Enterprise applications
  3. Click the + New application link at the top
  4. Search for "Azure AD SAML Toolkit" in the gallery
  5. Click on "Azure AD SAML Toolkit"
  6. Enter "Nextcloud" in the Name and click the Add button
@realslacker
realslacker / RegToXml.psm1
Last active Mar 11, 2021
Converts a .REG file into an XML document that is compatible with GPO preferences. The registry file can contain updates or deletions. The resulting XML file can be copy and pasted, or drag and dropped onto the GPO preferences registry window to import the file.
View RegToXml.psm1
<#
.SYNOPSIS
Converts a .REG file into an XML document that is compatible with GPO
preferences.
.DESCRIPTION
Converts a .REG file into an XML document that is compatible with GPO
preferences. The registry file can contain updates or deletions. The
resulting XML file can be copy and pasted, or drag and dropped onto the
GPO preferences registry window to import the file.
View Invoke-ADReplication.ps1
[CmdletBinding()]
param(
[Parameter( Mandatory, Position = 1, ValueFromPipelineByPropertyName, ValueFromPipeline )]
[Alias( 'HostName', 'Server' )]
[string[]]
$ComputerName,
[System.DirectoryServices.ActiveDirectory.SyncFromAllServersOptions]
$SyncOptions = @( 'CrossSite', 'PushChangeOutward', 'SkipInitialCheck' ),
@realslacker
realslacker / mRemoteNG-Password-Util.psm1
Last active Nov 15, 2020
Work with mRemoteNG passwords... Functionality has been rolled into https://github.com/realslacker/PSmRemoteNG
View mRemoteNG-Password-Util.psm1
Add-Type -Path 'C:\Program Files (x86)\mRemoteNG\BouncyCastle.Crypto.dll'
function ConvertFrom-MRNGSecurePassword {
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]
$EncryptedMessage,
@realslacker
realslacker / Update-StartLayoutInWim.ps1
Created Jan 30, 2018
Push a LayoutModification.xml file into a WIM prior to installation.
View Update-StartLayoutInWim.ps1
<#
.SYNOPSIS
Update the Start Menu layout in a WIM file
.DESCRIPTION
Update the Start Menu layout in a WIM file
.PARAMETER Path
The path to the WIM image file (typically install.wim)
View Update-WallpaperFromWindowsSpotlight.ps1
<#
.SYNOPSIS
Update your desktop wallpaper from Windows Spotlight using PowerShell
.NOTES
Author: Shannon Graybrook
Github: github.com/realslacker
#>
#requires -version 5.1