Skip to content

Instantly share code, notes, and snippets.

View DXPetti's full-sized avatar
🏠
Working from home

DXPetti

🏠
Working from home
View GitHub Profile
<#
.Synopsis
Search DHCP for the specified MAC address
.DESCRIPTION
This function enumerates through each scope in either a defined site or the current site and displays any DHCP lease or reservation that matches the MAC address specified
.EXAMPLE
Get-Mac -Mac 000000000000
.EXAMPLE
Get-Mac -Mac 0000 -DhcpSite CONTOSO
.EXAMPLE
<#
.DESCRIPTION
Powershell script that prompts user to accept license followed by installation of font and license files
.PARAMETERS
None - execute directly from Powershell
.Version
1.3
.Author
James Pettigrove
.Compatibility
# Import list of Users From CSV into $Userlist
$UserList=IMPORT-CSV driveletter:\pathtofile.csv
# Step through Each Item in the List
FOREACH ($Person in $UserList) {
# Build Username
<#
.DESCRIPTION
Powershell script to add DHCP vendor class and policies to allow Legacy BIOS based network booting (PXE) based upon information sent by client detailed in RFC 4578 (https://tools.ietf.org/html/rfc4578)
.PARAMETERS
None - execute directly from Powershell
.VERSION
1.0
.AUTHOR
James Pettigrove
.COMPATIBILITY
<#
.DESCRIPTION
Powershell script to remove DHCP policies that allows Legacy BIOS based network booting (PXE) based upon information sent by client detailed in RFC 4578 (https://tools.ietf.org/html/rfc4578)
.PARAMETERS
None - execute directly from Powershell
.VERSION
1.0
.AUTHOR
James Pettigrove
.COMPATIBILITY
<#
.Synopsis
Clean up machines with bad (old/corrupt) machine Registry.pol files
.DESCRIPTION
Taking a array as input, this cmdlet assists in keeping machines in a healthy state to accept Group Policy driven changes
by confirming the last modified date of the machines Registry.pol and if older than a day , remove it, (or doesn't exist)
followed by a forced Machine Policy update.
To work against older WMF/Powershell environments, invoke-command + invoke-gpupdate have been avoided.
.EXAMPLE
Repair-RegistryPol -Computers workstation1,workstation2
<#
.Synopsis
Install MiniKube + Kubectl
.DESCRIPTION
This script downloads the executables for MiniKube, Kubectl, configures Hyper-V as the hypervisor (if not configured already)
together with configuring a specific network adapter for use with the Minikube virtual machine
.EXAMPLE
Install-MiniKube
.NOTES
Version: 1.0
# As per https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/ADV200001
takeown /f $ENV:windir\syswow64\jscript.dll
cacls $ENV:windir\syswow64\jscript.dll /E /P everyone:N
takeown /f $ENV:windir\system32\jscript.dll
cacls $ENV:windir\system32\jscript.dll /E /P everyone:N
# As per https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/ADV200001
cacls $ENV:windir\system32\jscript.dll /E /R everyone
cacls $ENV:windir\syswow64\jscript.dll /E /R everyone
<#
.Synopsis
Backups up and sets the Out of Office message for all shared mailboxes
.DESCRIPTION
Taking a path plus message as input, this cmdlet gets all current mailboxes in specific OU, loops
through and takes a backup of (if any) Out of Office message plus parameters defined for the message.
In the same loop, the message inputted earlier is then defined as a Enabled, External Audience Out of
Office message.
.EXAMPLE
Set-SharedMbxOoo -Path C:\Temp\BackupOfOOO\ -Message "Hello there!"