Use PowerShell’s Invoke-WebRequest to report if a website is up or down

If Internet Control Message Protocol (ICMP) — a protocol used to communicate problems with data transmission — is disabled, PowerShell’s Invoke-WebRequest can be a helpful alternative to use to monitor of a website is up or down. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 …

Use IPdeny to create Mail flow rules (transport rules) in Exchange Online

This PowerShell script will help an Office 365 administrator or Exchange Online administrator block incoming email messages originating from specific countries using data from IPdeny. About IPdeny country block downloads IPdeny compiles raw data from regional internet registries and offers free of charge country IP address block downloads. Their country IP zone files can be …

Use PowerShell to log logon and logoff activity on domain computers

There are many ways to log user activity on a domain. One of the ways that I prefer is to write user logon and logoff activity to plain text files on a network share. I used to do this via a .bat file, but recently rewrote the process using PowerShell. Create a Shared Folder for …

Remove spaces from column names when using PowerShell’s Import-Csv

When using PowerShell’s Import-Csv cmdlet, it is ideal for the column headings in the source file to not have any spaces. While the import will work, later referencing values in each column heading is messy. Let me demonstrate. Messy Column Headers with spaces Let’s say your source file looks like this. Note that there are …

Using PowerShell to clean up DHCP and DNS for VDI

When you run a virtual desktop infrastructure that builds and deletes hundreds of virtual machines every day, DHCP and DNS might eventually get out of sync and need some cleanup. When writing this PowerShell cleanup script, I decided to make vCenter my source of truth because has the virtual machine host names, IP addresses, power …