Skip to content

Instantly share code, notes, and snippets.

View Rugby-Ball's full-sized avatar

Ed Walsh Rugby-Ball

View GitHub Profile
@Rugby-Ball
Rugby-Ball / Azure-FireWall-Status-Inventory.ps1
Created April 24, 2024 19:26
For Azure, get inventory of running Windows servers and status of the three Firewall Profiles. #Utility #Security #Public #Inventory #Audit #Azure
# Azure-FireWall-Status-Inventory.ps1
<#
Description: For Azure, get inventory of running Windows servers and status of the three Firewall Profiles.
Edited by: Ed Walsh
PowerShell.Core tested: Yes
MS-Graph: No
Version: 1.0.0
Create Date: 4/23/2024
Revised Date: 4/23/2024
#>
@Rugby-Ball
Rugby-Ball / Azure-Recovery-Point-Inventory.ps1
Created April 22, 2024 20:44
For Azure, get inventory of Recovery Point Backups showing Earliest and Latest and count of Recovery Points. #Utility #Public #Inventory #Audit #BackUp #Azure
# Azure-Recovery-Point-Inventory.ps1
<#
Description: For Azure, get inventory of Recovery Point Backups showing Earliest and Latest and count of Recovery Points.
Edited by: Ed Walsh
PowerShell.Core tested: Yes
MS-Graph: No
Version: 1.0.0
Create Date: 4/22/2024
Revised Date: 4/22/2024
#>
@Rugby-Ball
Rugby-Ball / Azure-backup-Inventory.ps1
Created April 16, 2024 03:32
For Azure, get inventory of backups for all Subscriptions. Saved to a CSV file. #Utility #Public #Inventory #Backup #Azure
# Azure-backup-Inventory.ps1
<#
Description: For Azure, get inventory of backups for all Subscriptions. Saved to a CSV file.
Original: https://stackoverflow.com/a/63116991/9776353
Edited by: Ed Walsh
PowerShell.Core tested: Yes
MS-Graph: No
Version: 1.0.0
Create Date: 4/15/2024
Revised Date: 4/15/2024
@Rugby-Ball
Rugby-Ball / Get-hotfix-installed-for-list-of-servers.ps1
Created March 19, 2024 21:34
This will pull a list of installed patches using Get-Hotfix cmdlt for a list of servers. And export out to an Excel file. Requires the Module ImportExcel to be installed and imported. #Utility #Public #Inventory #Security #Audit #Windows #Patching
# Get-hotfix-installed-for-list-of-servers.ps1
<#
Description: This will pull a list of installed patches using Get-Hotfix cmdlt for a list of servers. And export out to an Excel file.
Requires the Module ImportExcel to be installed and imported.
Written: Ed Walsh
PowerShell.Core tested: Yes
MS-Graph: No
Version: 1.0.0
Create Date: 3/19/2024
Revised Date: 3/19/2024
@Rugby-Ball
Rugby-Ball / list-all-windows-servers-last-date-patched.ps1
Last active February 14, 2024 22:50
Pulls a list of AWS Windows servers, and then scans each for the date of last patch done one server. Exports to a CSV file. #AWS #Public #Inventory #Security #Utility #Audit #Windows #Patching
#list-all-windows-servers-last-date-patched.ps1
#Use to pull a list of running servers (Windows and/or Linux depending on what you select in $Filters) removing any that are not in AD and are associated to WORKGROUP.
$stopWatch = [System.Diagnostics.Stopwatch]::StartNew()
$stopwatch.Start()
$stopWatch2 = [System.Diagnostics.Stopwatch]::StartNew()
$stopwatch2.Start()
Import-Module -name AWSPowershell
$Servers = @()
@Rugby-Ball
Rugby-Ball / aws-ec2-snapshot-count-aged-out-and-totalvolume.ps1
Last active February 6, 2024 20:02
Get the count of Snapshots for an AWS account, along with count over set days old, and what is oldest date of snapshot and total Snapshot Volume. #AWS #Snapshots #Utility #Public #AWS_ELB
# aws-ec2-snapshot-count-aged-out-and-totalvolume.ps1
<#
Description: Get the count of Snapshots for an AWS account, along with count over set days old, and what is oldest date of snapshot and total Snapshot Volume.
This WILL NOT delete anything, it is just informational on snapshot counts and aged out counts.
Written: Ed Walsh
PowerShell.Core tested: Yes
MS-Graph: No
Version: 1.2.1
Create Date: 12/9/2020
Revised Date: 2/6/2024
@Rugby-Ball
Rugby-Ball / Windows_UpDate_Installed.ps1
Created January 26, 2024 16:37
This pulls a list of Windows Patches installed. It shows more patches than Get-HotFix alone does. #Public #Security #Inventory #Utility #Audit #Windows #Patching
#Pull list of installed Windows Patches on a server.
# This pulls more patches installed than Get-HotFix does.
##Check if c:\temp exists, if it doesnt create it.
If(-not(Test-Path -Path "c:\temp"))
{New-Item -ItemType Directory -Force -Path C:\temp}
#
#RegEx to pull the KB number from the Title field.
$regex = "(KB.[0-9]*)"
$hostname = Hostname
$Session = New-Object -ComObject "Microsoft.Update.Session"
@Rugby-Ball
Rugby-Ball / azure-vm-detail-inventory.ps1
Last active March 26, 2024 21:22
Pull all VM's for an Azure Subscription, includes details. #Public #Inventory #Azure #Azure_VM
# azure-vm-detail-inventory.ps1
<#
Description: Pull all VM's for an Azure Subscription, includes details.
Written: Ed Walsh
PowerShell.Core tested: Tested
Version: 1.3
Create Date : 12/15/2023
Revised Date: 3/22/2024
#>
@Rugby-Ball
Rugby-Ball / ad-user-information.ps1
Last active November 3, 2023 17:19
Pull information on an Active Directory user #Utility #Public #Security #Active_Directory #Snippet
# ad-user-information.ps1
# 11/1/2023
# Requires PowerShell AD Module to be installed.
# This website shows how to do this: https://4sysops.com/wiki/how-to-install-the-powershell-active-directory-module/
# This will pull information on a user in your Active Directroy.
# if you add | clip for Windows or | pbcopy for MacOS at the end of script, output will go to the clipboard.
Get-ADUser -Filter "Name -like '*chris*'" -Properties * | select @{n="DateRun";e={get-date -f "MM/dd/yyyy hh:mm tt"}},AccountExpirationDate, CanonicalName, CN, Company, createTimeStamp, SamAccountName, DisplayName, EmailAddress,LastLogonDate,logonCount,PasswordExpired,PasswordLastSet,enabled,LockedOut,Manager
@Rugby-Ball
Rugby-Ball / AWS-Running-Windows-servers-Local-User-Accounts-list.ps1
Last active October 31, 2023 18:32
Pulls a lit of all AWS EC2 Windows that are running, and compiles a list of Local User accounts for each server across all AWS regions. (note: Windows Domain Controllers do not have local accounts.) #Inventory #AWS #Windows #Utility #Public #Security
# AWS-Running-Windows-servers-Local-User-Accounts-list.ps1
<#
Description: Pulls a lit of all AWS EC2 Windows that are running, and compiles a list of Local User accounts for each server across all AWS regions. (note: Windows Domain Controllers do not have local accounts.)
Written: Ed Walsh
PowerShell.Core tested: Yes
MS-Graph: No
Version: 1.0.1
Create Date: 10/31/2023
Revised Date: 10/31/2023
#>