Skip to content

Instantly share code, notes, and snippets.

# Quick way to bulk deploy a baseline to alot of collections
# make sure to edit:
## BaselineName
## Collections
## Schedule
if((Get-Module ConfigurationManager) -eq $null) {
Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1"
}
<#
.SYNOPSIS
Retrieves information about installed applications based on different search modes.
.DESCRIPTION
The Get-InstalledApps function retrieves information about installed applications based on various search modes
such as Registry, CmCIM, or File. It allows querying by application name, version, and search mode.
.PARAMETER Appname
The name of the application to search for.
.PARAMETER Version
The version of the application to search for.
@HighLibrarian
HighLibrarian / Clear-GroupPolicyCache.ps1
Last active March 26, 2024 11:13
Clear-GroupPolicyObjectCache.ps1
<#
.SYNOPSIS
This script clears the local GPO cache for both user and device levels using remove-item commands.
.DESCRIPTION
This script clears the local GPO cache for both user and device levels using remove-item commands.
It stops any ongoing transcript, starts a new transcript for logging purposes, clears the GPO cache,
and then starts a new transcript for logging purposes.
.NOTES
Author: BDW
Date: 26/03/2024
@HighLibrarian
HighLibrarian / Add-DevicesToEntraIdGroup.ps1
Created April 16, 2024 07:59
Add-DevicesToEntraGroup
$GroupId = ""
$devicelist = get-content .\devicelist.csv | ConvertFrom-Csv
foreach ($device in $devicelist)
{
write-host "adding $($device.devicename) to our group"
$DeviceID = $device.MicrosoftEntradeviceID
$EntraDeviceID = Get-MgDevice -Filter "DeviceId eq '$DeviceID'" | Select-Object -ExpandProperty id
New-MgGroupMember -groupid $GroupId -DirectoryObjectId $EntraDeviceID
@HighLibrarian
HighLibrarian / start-IntuneDeviceSync.ps1
Last active April 16, 2024 08:18
makes intune devices sync their policies
$GroupId = "bc8b6f66-fd59-412f-9b2e-1a0de52466a5"
# Importing the SDK Module
Import-Module -Name Microsoft.Graph.DeviceManagement.Actions
Connect-MgGraph -scope DeviceManagementManagedDevices.PrivilegedOperations.All, DeviceManagementManagedDevices.ReadWrite.All,DeviceManagementManagedDevices.Read.All
#### Gets All devices
$Devices = Get-MgGroupMember -GroupId $GroupId
Foreach ($Device in $Devices)
@HighLibrarian
HighLibrarian / ObsidianToHugo.ps1
Created May 14, 2024 13:02
This script preps obsidian notes for Hugo usage
# ______ __ _
# / ____/_ ______ _____/ /_(_)___ ____ _____
# / /_ / / / / __ \/ ___/ __/ / __ \/ __ \/ ___/
# / __/ / /_/ / / / / /__/ /_/ / /_/ / / / (__ )
# /_/ \__,_/_/ /_/\___/\__/_/\____/_/ /_/____/
function Get-YamlFrontMatter
{
param
@HighLibrarian
HighLibrarian / Set-GoDaddyDnsRecord.ps1
Created November 28, 2024 13:48
GoDaddy update DNS
<#
This script is used to check and update your GoDaddy DNS server to the IP address of your current internet connection.
First go to GoDaddy developer site to create a developer account and get your key and secret
https://developer.godaddy.com/getstarted
Update the first 4 varriables with your information
#>
$domain = '' # your domain
$key = '' #key for godaddy developer API
@HighLibrarian
HighLibrarian / New-DifferencingVm.ps1
Last active December 16, 2024 11:09
New-DifferencingVm
function New-DifferencingVm
{
param (
[Parameter(Mandatory=$true)]
[string]$VMName,
[Parameter(Mandatory=$false)]
[string]$DiskName=$VMName,
[Parameter(Mandatory=$false)]
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@HighLibrarian
HighLibrarian / MyPowerShellProfile.ps1
Last active October 27, 2025 08:12
DailyPowerShellProfile
<#
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%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