Skip to content

Instantly share code, notes, and snippets.

View SweetAsNZ's full-sized avatar
🏠

Tim West SweetAsNZ

🏠
View GitHub Profile
@jdhitsolutions
jdhitsolutions / ADChangeReport.ps1
Created January 27, 2021 18:23
A PowerShell script to create an HTML report on recent changes in Active Directory.
#requires -version 5.1
#requires -module ActiveDirectory,DNSClient
# https://jdhitsolutions.com/blog/powershell/8087/an-active-directory-change-report-from-powershell/
#Reporting on deleted items requires the Active Directory Recycle Bin feature
[cmdletbinding()]
Param(
[Parameter(Position = 0,HelpMessage = "Enter a last modified datetime for AD objects. The default is the last 4 hours.")]
[ValidateNotNullOrEmpty()]
@compwiz32
compwiz32 / Prompt.ps1
Last active November 19, 2022 05:26
Script for article - "Customize your PowerShell commnd prompt"
function prompt {
#Assign Windows Title Text
$host.ui.RawUI.WindowTitle = "Current Folder: $pwd"
#Configure current user, current folder and date outputs
$CmdPromptCurrentFolder = Split-Path -Path $pwd -Leaf
$CmdPromptUser = [Security.Principal.WindowsIdentity]::GetCurrent();
$Date = Get-Date -Format 'dddd hh:mm:ss tt'
@jdhitsolutions
jdhitsolutions / New-HVHealthReport.ps1
Last active September 26, 2023 19:42
A PowerShell control script to create a heath report on a Hyper-V server and its virtual machines.
#requires -version 5.1
<#
.SYNOPSIS
Create an HTML Hyper-V health report.
.DESCRIPTION
This command will create an HTML-based Hyper-V health report. It is designed to report on Hyper-V 3.0 or later servers or even Client Hyper-V on Windows 10. This script will retrieve data using PowerShell remoting from the Hyper-V Host. It is assumed you will run this from your desktop and specify a remote Hyper-V host. You do not need any Hyper-V tools installed locally to run this script.
The report only shows virtual machine information for any virtual machine that is not powered off. If you include performance counters, you will only get data on counters with a value other than 0.
<#
.Synopsis
Gets information of a port number
.DESCRIPTION
Function provides detailed information of port numbers, like - the service which use the port, Transport protocol and a small decsription.
.EXAMPLE
PS > Get-Port -Port 20,21,53
Port Service Protocol Description
---- ------- -------- -----------