Skip to content

Instantly share code, notes, and snippets.

View realslacker's full-sized avatar

Shannon Graybrook realslacker

View GitHub Profile
#Requires -Version 4.0
<#
.SYNOPSIS
Convert DHCP address to static on a remote machine.
.DESCRIPTION
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
change.

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 / Enable-ADReplicationChangeNotification.ps1
Last active October 4, 2019 14:28
This function performs the configuration change described by the article "Active Directory Replication: Change Notification & You" by Chad Duffey (see: https://blogs.msdn.microsoft.com/canberrapfe/2012/03/25/active-directory-replication-change-notification-you/)
#requires -Modules ActiveDirectory
<#
.SYNOPSIS
Enables Change Notification on IP AD Replication Site Links
.PARAMETER SiteLink
The DistinguishedName of the SiteLink to modify.
.PARAMETER Domain
<#
.SYNOPSIS
Creates an Immediate Scheduled Task
.PARAMETER ComputerName
The computer(s) for the task to be executed.
.PARAMETER TaskName
The name of the task.
<#PSScriptInfo
.VERSION 2019.3.25.900
.GUID cd6e3726-52d2-4ae0-b423-1d4d8853775f
.AUTHOR Shannon Graybrook
.COMPANYNAME Methode Electronics
@realslacker
realslacker / PSmRemoteNG.psd1
Last active September 20, 2019 21:15
Latest version available now on GitHub -> https://github.com/realslacker/PSmRemoteNG
#
# Module manifest for module 'PSmRemoteNG'
#
# Generated by: Shannon Graybrook
#
# Generated on: 7/18/2019
#
@{
@realslacker
realslacker / Invoke-GPOScriptReport.ps1
Created May 20, 2019 19:49
Get all Group Policy Objects with scripts
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
realslacker / mRemoteNG-Password-Util.psm1
Last active November 15, 2020 18:59
Work with mRemoteNG passwords... Functionality has been rolled into https://github.com/realslacker/PSmRemoteNG
Add-Type -Path 'C:\Program Files (x86)\mRemoteNG\BouncyCastle.Crypto.dll'
function ConvertFrom-MRNGSecurePassword {
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]
$EncryptedMessage,
@realslacker
realslacker / WmiNameSpaceSecurity.psm1
Created April 16, 2019 20:01
A module with expanded functionality base on original work by Steve Lee and Graeme Bray. See Set-WMINameSpaceSecurity.ps1 for original.
<#
Disclaimer:
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
@realslacker
realslacker / wmi_filters.ps1
Created February 23, 2019 22:12
WMI Filters
# 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