Skip to content

Instantly share code, notes, and snippets.

View rstolpe's full-sized avatar

Robin Stolpe rstolpe

View GitHub Profile
@rstolpe
rstolpe / Remove-PrintersFromComputers.ps1
Last active February 16, 2024 14:43
Helping with deleting printers
Function Remove-PrintersFromComputers {
<#
Remove-PrintersFromComputers -PrinterToExclude "Printer1, Printer2, *Printer4*" -ComputerName "Computer1"
#>
[CmdletBinding()]
Param(
[String]$ComputerName = "localhost",
[String]$PrinterToExclude
@rstolpe
rstolpe / unlock_aduser.ps1
Created June 29, 2022 17:21
Unlock AD Account
Function Unlock-ADAccounts {
#[CmdletBinding()]
#Param(
# [Parameter(Mandatory = $true)][array]$UserNames =
#)
[string]$UserNames = Read-Host -Prompt "What users do you want to check? (separate the users with ,)"
[array]$UserNames = $UserNames -split ","
# Checks if the Active Directory module are loaded if it's not then it imports it.
if (-Not(Get-Module -ListAvailable -Name "ActiveDirectory")) {
try {