I’ve been using this script on a Synology NAS to monitor other hosts on the same network. In the event that a host stops responding to ping, a notification is sent by Healthchecks.io. This allows me to use the NAS as a basic availability monitor for other devices on the network.
Continue readingHere’s a PowerShell script that can be used to scan for Windows updates, install them and optionally restart the system automatically. I’ve been using this for a few years now on Windows Server 2008 R2 and above without issues.
Continue readingFor a time, I had a server with an issue where the IIS SMTP virtual server stopped due to an error. My usual automatic checks for stopped Windows services didn’t pick this up because the Windows service continued to run, even though the SMTP virtual server had stopped.
This caused some internal emails to be delayed. It was easy enough to start the virtual server again, but better to put a script in place to check the status and start the SMTP virtual server if necessary.
Continue readingHere’s a PowerShell script for a function to send email with optional attachments. It accepts a comma-separated list of attachments, or no attachments at all.
You can include this in other PowerShell scripts to make this function available, rather than having the email sending functionality repeated in multiple scripts.
Continue readingI recently got an error deleting a shared mailbox: The following error occurred during validation in agent ‘Windows LiveId Agent’: ‘Unable to perform the save operation. ‘shared-mailbox-user’ is not within a valid server write scope.’
Continue readingYou can use JavaScript within Photoshop to automate almost any process. In this example, we’ll use it to open a specific file in a batch workflow (action).
For this quick example, we have 2 folders of image files; 1 folder containing background images and another folder containing text layers. Each set of files follows the same naming convention as follows:
Continue readingHere’s a quick one-liner that can rename multiple files with PowerShell. The rename-item cmdlet can be used to search and replace text in the original filename.
dir "c:\Work" -s | rename-item -NewName {$_.name -replace "text-to-find","repacement-text"}
Continue reading
If you’re finding that a website containing a lot of JavaScript is performing badly on a particular browser/device you can run the Browserbench.org Speedometer. That will check the performance of that device and you can then compare it against some known results.
Continue readingHere’s a quick PowerShell script which allows you to set the computer description remotely.
You’ll need to run this in a PowerShell window with administrative rights for the remote PC.
$RemotePC = Read-Host -Prompt 'Input the remote computer name e.g. PC0123'
$RemoteDescription = Read-Host -Prompt 'Input the new description for the remote computer'
$PC = Get-WmiObject -class Win32_OperatingSystem -computername $RemotePC
$PC.Description = $RemoteDescription
$PC.Put()
Sometimes you need a quick and simple way to backup a user directory to a network drive/NAS share or external drive.
Here’s a batch file that will backup using Robocopy the subdirectories of your user directory to the location of your choice.
Continue reading