Skip to content

Instantly share code, notes, and snippets.

View scottglew's full-sized avatar

Scott Glew scottglew

View GitHub Profile
@scottglew
scottglew / Recursive-Directory-Listing-with-File-Size.ps1
Created October 23, 2023 10:16
Recursively searches all sub-folders in the current location and outputs a csv file listing all file and folder sizes, and the number of files in each folder.
# Get the current directory
$currentDir = Get-Location
# Prompt the user for a filename to save the results
$filename = Read-Host -Prompt "Enter the filename to save the results (e.g., output.csv)"
# Use an ArrayList for more efficient data collection
$results = New-Object System.Collections.ArrayList
# Hashtable to store folder sizes and file counts
@scottglew
scottglew / logarchiver.plx - Sophos UTM Remote Log Archive Test
Last active August 29, 2015 14:07
Forces Sophos UTM to create a test log in the Remote Log Archive and produces verbose output on success or failure
logarchiver.plx -t -d 15
@scottglew
scottglew / AllowSyslogInPowerShell
Last active August 29, 2015 14:07
PowerShell command to allow syslog through the Windows Firewall for Fastvue Sophos Reporter
New-NetFirewallRule -Name Allow_Syslog -DisplayName "Allow Syslog" -Description "Allows inbound syslog port 514" -Protocol UDP -Enabled True -Profile Any -Action Allow
@scottglew
scottglew / Forefront TMG Enterprise Configuration Backup (Save as AutoExportEnterprise.vbs)
Last active December 21, 2015 03:39
This script exports the Forefront TMG Enterprise and Array configuration as a backup
' TMG Enterprise and Array Configuration Backup Script
'
' Purpose: The Script exports the Enterprise and Array configuration as a backup
' Changes Required: Specify a custom password, comment and backup location. Save the script as AutoExportEnterprise.vbs.
' Usage: Execute the scrip on the EMS server with the following command
' cscript AutoExportEnterprise.vbs
'
' ********** Supplied by @FastVue / @WebSpy / @FixMyITSystem / @JasonJonesUK / @RichardHicks **********
'
' ----------------------------------------------------------------------------------------
@scottglew
scottglew / Forefront TMG Array Configuration Backup Script (Save as AutoExportArray.vbs)
Last active December 27, 2017 12:09
This script exports your Forefront TMG Array configuration as a backup.
' TMG Array Configuration Backup Script
'
' Purpose: The Script exports the Array configuration as a backup
' Changes Required: Specify a custom password, comment and backup location. Save as AutoExportArray.vbs.
' Usage: Execute the scrip on the TMG server with the following command
' cscript AutoExportArray.vbs
'
' ********** Supplied by @Fastvue / @WebSpy / @FixMyITSystem / @JasonJonesUK / @RichardHicks **********
'
' ----------------------------------------------------------------------------------------