PowerShell function Get-QUser will parse results of “query user” into an array

This PowerShell function will help Windows administrators use the output of “query user” or “quser” as a PowerShell array. query user: raw output “query user” or “quser” output in Windows looks like this: 1 2 3 USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME username1 1 Disc 19:12 9/22/2023 8:38 AM username2 console 2 Active …

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 …

PowerShell Functions to Get Logged On User and Logoff Logged On User

Two helpful PowerShell functions to help you check who is logged on remotely and to remotely log them off. Remotely Get a Logged On User This Get-LoggedOnUser will use Get-WmiObject to tell you who is logged on to a remote computer. You may use a comma-delimited list of computer names. Function: 1 2 3 4 …

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 …

PowerShell Set-ADAccountPassword -WhatIf bug

Today (2017 March) I unfortunately learned of the -WhatIf bug for the PowerShell Active Directory cmdlet Set-ADAccountPassword. About -WhatIf “-WhatIf” is a common PowerShell System State parameter that is supposed to “Explain what will happen if the command is executed, without actually executing the command.(Boolean ) -whatif:$false or -whatif:$true.” I use it all of the …