How to build a colourful GUI for PowerShell using Winforms, RunspacePools and Hash Tables.
PowerShell
HVTools Major Update – 1.6.5
Overview A lot of bug fixes and features packed into this release! Enjoy 😉 Changelog Other cosmetic improvements.1.6.5 Rounded off large number column values.Search filter now works across all tabs.Added reset counter for clusters $c in ClusterNetworks foreach loop.1.6.4 Added tab filter for all 8 datagrids.1.6.3 Major update. Packed new features in including Clusters, Hosts, … Continue reading HVTools Major Update – 1.6.5
KVT Tool Major Update – 1.5.7
Overview Great news! I have recently performed major upgrades to KVT Tool. These new features bring both beauty and finesse. Noteworthy mentions: Moved away from traditional PS arrays. Now using data table objects.Improved UI by leveraging DataGridView and TabControl forms.Unfroze the UI! Achieved this thanks to [runspacefactory] RunspacePools. Took a little while to master, but … Continue reading KVT Tool Major Update – 1.5.7
SCVMM Health Capacity Report
Are you in the phase of capacity planning for VM migration off your Hyper-V / System Center Virtual Machine Manager (SCVMM) environment? Do you need a capacity report of all running VMs and their allocated resources including CPU, memory, storage and network? Check out the below PowerShell script which I've created to help produce the … Continue reading SCVMM Health Capacity Report
Connect to AWS CLI via Powershell
In this tutorial, you can connect your Powershell terminal to AWS CLI using SAML2AWS. Especially handy for AWS tenancies utilising MFA authentication. Pre-requisites Powershell 5.1 Chocolatey SAML2AWS Instructions Launch elevated Powershell. Execute CMDLET Set-ExecutionPolicy Bypass -Scope Process. Download and save Chocolatey installation script. Install Chocolatey by executing installation script using CMDLET .\install.ps1. Wait for it … Continue reading Connect to AWS CLI via Powershell
Terraform Variables
Similar to all other programming languages, Terraform also makes use of variables for dynamic coding. You can have a dedicated Terraform variables file with extension .TFVARS within your working directory/folder and this will automatically be referenced in your main Terraform code file, so you can call directly and/or interpolate. There are several different types of … Continue reading Terraform Variables
Universal VMware Tools Uninstaller
I've created the following Powershell script which will uninstall all versions of VMware Tools from a server. Particularly handy for SCCM deployment. uninstall_vmware_tools.ps1 $regpath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $regkey = gci $regpath | Get-ItemProperty | Where-Object{"VMware Tools" -contains $_.DisplayName} #Uninstall String msiexec /x $regkey.PSChildName /qn #Reboot server within 120 seconds. shutdown -r -f -t 120 The … Continue reading Universal VMware Tools Uninstaller
Home Folder – Compare folders against current domain users
Here is a PowerShell script which probes network home folders with users against the domain. Helpful in order to determine which home folders no longer reference current user accounts and which can safely be removed/archived. $folders = gci "\\Domain.Local\DFS\Users" #This is the root path containing home folders. foreach ($folder in $folders) { $username1 … Continue reading Home Folder – Compare folders against current domain users
Exchange 2013 – Get Mailbox Size Statistics
Here is an Exchange Shell script which is helpful in determining mailbox sizes. Queries all user objects within an OU so it is nifty for producing statistics, especially for disabled users. $mailboxes = Get-mailbox –OrganizationalUnit “domain.local/CompanyName/Disabled Users” foreach ($mailbox in $mailboxes) { $name = $mailbox.Name Get-MailboxStatistics $name | Sort -Property TotalItemSize | Select-Object … Continue reading Exchange 2013 – Get Mailbox Size Statistics
Home Folder – Archiving Disabled Users
Here is aPowerShell script to archive all users within an organisational unit (Disabled Users) to a network path. Prerequisite is to grant your Administrator account with ownership/full control permissions to home folders in question prior move. If this condition is not met, then original home folders will remain with remnant data which was inaccessible. $users … Continue reading Home Folder – Archiving Disabled Users