Skip to content

Instantly share code, notes, and snippets.


Shannon Graybrook realslacker

View GitHub Profile
realslacker / Reset-ADUserAdminCount.ps1
Created May 19, 2022
Reset a user account adminCount and restore the default ACL.
View Reset-ADUserAdminCount.ps1
#requires -Modules ActiveDirectory
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=(?:(?<=\\),|[^,])+)|$))+$'
View Invoke-ADReplication.ps1
[Parameter( Mandatory, Position = 1, ValueFromPipelineByPropertyName, ValueFromPipeline )]
[Alias( 'HostName', 'Server' )]
$SyncOptions = @( 'CrossSite', 'PushChangeOutward', 'SkipInitialCheck' ),
View Update-WallpaperFromWindowsSpotlight.ps1
Update your desktop wallpaper from Windows Spotlight using PowerShell
Author: Shannon Graybrook
#requires -version 5.1
realslacker / Add-WindowsCapability.ps1
Last active Oct 30, 2019
Module with Add-WindowsCapability proxy function to which allows bypassing WSUS for Add-WindowsCapability.
View Add-WindowsCapability.ps1
# iex ((New-Object System.Net.WebClient).DownloadString(''))
#Requires -Modules DISM
function Add-WindowsCapability {
[Parameter(ParameterSetName='Online', ValueFromPipelineByPropertyName=$true)]
[Parameter(ParameterSetName='Offline', ValueFromPipelineByPropertyName=$true)]
View Convert-NetIPAddressToStatic.ps1
#Requires -Version 4.0
Convert DHCP address to static on a remote machine.
Convert a DHCP lease address to a static IP address assignment on a remote machine.
Uses PSRemoting to detect IP settings and a scheduled task to make the IP configuration
View HOWTO Nextcloud SAML Login with

Enable Nextcloud SAML Login using AzureAD

Create an Enterprise App for Nextcloud

  1. Open the Azure admin portal -
  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 / Enable-ADReplicationChangeNotification.ps1
Last active Oct 4, 2019
This function performs the configuration change described by the article "Active Directory Replication: Change Notification & You" by Chad Duffey (see:
View Enable-ADReplicationChangeNotification.ps1
#requires -Modules ActiveDirectory
Enables Change Notification on IP AD Replication Site Links
The DistinguishedName of the SiteLink to modify.
View ImmediateScheduledTask.psm1
Creates an Immediate Scheduled Task
.PARAMETER ComputerName
The computer(s) for the task to be executed.
The name of the task.
View Install-Win10RSAT.ps1
.VERSION 2019.3.25.900
.GUID cd6e3726-52d2-4ae0-b423-1d4d8853775f
.AUTHOR Shannon Graybrook
.COMPANYNAME Methode Electronics