
PowerShell script to check on 503 error and sent to IT Support
PowerShell script to run a report in a table on a remote server to check web status is ok, if 503 error, highlight in yellow with a bold red font and send only if error via email to IT Support as html. <### Code Explanation: This PowerShell script is designed to monitor the status of…
Read more

PowerShell script that checks the status of a web server
Here’s a PowerShell script that checks the status of a web server by running a report, highlights any 503 errors in yellow with bold red font, and sends the results via email as an HTML table to IT Support. This script assumes you have the necessary permissions and configurations for email sending and server access.…
Read more

PowerShell Script to gather information from Remote server and email it.
Here is a PowerShell script that gathers CPU utilization, memory usage, disk space, and uptime information from a remote server, formats it into an HTML table, and sends it via email to IT Support. Make sure to run this script with appropriate permissions and update the placeholders with your specific details. # Define variables $RemoteServer…
Read more

PowerShell script for server information in an email report
PowerShell script that gathers server CPU and memory utilization, disk space, and uptime, generates a report, and sends it via email to IT Support. This script uses WMI and requires SMTP configuration for email functionality. # **Configuration Section** $SMTPServer = “smtp.yourdomain.com” # Replace with your SMTP server $SMTPPort = 587 # Replace with your SMTP…
Read more

PowerShell Download script ideas
These are just PowerShell Scripted ideas playing around with to understand the scripting process.

Server Status Report
Server Status Report from PowerShell to HTML for CPU, Memory, IP Address, and Hard Drive information. # Define the input file containing server names (one per line) $ServerListFile = “D:\Lists\Servers.txt” # Text file containing server names (one per line) # Define the output HTML file $OutputHtmlFile = “C:\Logs\ServerStatusReporttbl.html” # Path to save the HTML report…
Read more

Powershell form close form after 30 minutes if no activity exists
To close a PowerShell form after 30 minutes of inactivity, you can use a timer to track user activity and close the form if no interaction occurs within the specified time. Below is an example script using Windows Forms: # Load Windows Forms assembly Add-Type -AssemblyName System.Windows.Forms # Create the form $form = New-Object System.Windows.Forms.Form…
Read more

RDP by selecting list of systems
I was looking for a way to select from a list of systems to RDP into and came up with a combo box inside of a form. Simple form display Add-Type -AssemblyName System.Windows.Forms # Create the form $form = New-Object System.Windows.Forms.Form $form.Text = “RDP Connection” $form.Size = New-Object…
Read more

Powershell run 5 batch file, create a log file, and verify folder location if not create folder
Below is a PowerShell script that will run five batch files, create a log file, and verify if a folder exists. If the folder does not exist, it will create the folder. # Define the folder path and log file path $folderPath = “C:\YourFolderPath” $logFilePath = “C:\YourFolderPath\log.txt” # Verify if the folder exists, if not,…
Read more

Powershell run 5 batch files, create a log file, and verify folder location
Recently was asked to run a series of batch files. Below is a PowerShell script that will run five batch files, create a log file for each execution, and verify the folder location before running the batch files. # Define the folder location and batch files $folderPath = “C:\Path\To\Your\BatchFiles” $batchFiles = @(“batch1.bat”, “batch2.bat”, “batch3.bat”, “batch4.bat”,…
Read more

PowerShell script function file download, unblock and install with multiple parameters and return installed version
Here’s a PowerShell script that defines a function to download a file, unblock it, install it, and return the installed version. The function accepts multiple parameters for flexibility. function Install-Software { param ( [Parameter(Mandatory = $true)] [string]$DownloadUrl, [Parameter(Mandatory = $true)] [string]$DestinationPath, [Parameter(Mandatory = $true)] [string]$InstallerArguments, [Parameter(Mandatory = $true)] [string]$VersionCommand ) try { # Step 1:…
Read more

PowerShell – BIOS Version
Looking to see what the current BIOS version is by running the following PowerShell script. This provides Manufacturer, version and the release date $bios = Get-CimInstance -ClassName CIM_BIOSElement $bios | Select-Object Manufacturer, Version, ReleaseDate

PowerShell Function to Set-RegistryValueForAllUsers
Below is a PowerShell function that sets a registry value for all users on a Windows machine. This function will iterate through all user profiles and set the specified registry value. function Set-RegistryValueForAllUsers { param ( [Parameter(Mandatory = $true)] [string]$RegistryPath, [Parameter(Mandatory = $true)] [string]$ValueName, [Parameter(Mandatory = $true)] [string]$ValueData, [Parameter(Mandatory = $false)] [Microsoft.Win32.RegistryValueKind]$ValueType = [Microsoft.Win32.RegistryValueKind]::String )…
Read more

PowerShell to set the registry for all users
Here is a PowerShell script that sets a registry value for all users on a Windows machine. This script modifies the registry under the HKEY_USERS hive, which contains subkeys for each user profile. # Define the registry path and value $registryPath = “Software\YourApp\Settings” $valueName = “YourSetting” $valueData = “YourValue” # Get all user SIDs $userSIDs…
Read more

PowerShell – Stop process before Service
## Stop process before Service # Define the process name and service name $processName = “YourProcessName” $serviceName = “YourServiceName” # Stop the process $process = Get-Process -Name $processName -ErrorAction SilentlyContinue if ($process) { Stop-Process -Name $processName -Force Write-Output “Process ‘$processName’ has been stopped.” } else { Write-Output “Process ‘$processName’ is not running.” } # Stop…
Read more

PowerShell – Working on a template build – rough draft
I am working on updating a process for installing software…I like the audio process for letting me know where in the code I am at in the process. Rough draft see if I can figure a way to streamline this process. #################################################################### ## Write-Host “`n” Write-Host ” ————————————————- ” -ForegroundColor Cyan Write-Host ” | |…
Read more

Find the Hostname of a Hyper-V Virtual Machine (VM)
If you are running a virtual machine (VM) on Hyper-V, sometimes you want to know on which Hyper-V host this VM is running. I work on a lot of VM’s and this is cool part of knowing where to look, especially when troubleshooting. If you don’t have access to the Hyper-V host, you need to…
Read more

Creating Hyper-V VM with PowerShell
I was trying to learn how to create a VM in Windows 2019 Hypervisor with PowerShell. Microsoft Resource was a big help. Some of things that I started to learn was how to setup VM Switches, enable VLAN, create and configure a VM that would show up in Hyper-V and the settings needed to run.…
Read more

PowerShell API Wrapper Links
API Wrapper links from online sources. A module for simple integration with Atlassian HipChat via the HipChat API. This PowerShell module contains commands to manage GitHub through its REST API. Powershell cmdlets that expose the GitHub API. PowerShell cmdlets for interacting with GitHub Gist. A PowerShell module to work with GitHub Gists. A PowerShell Module…
Read more