Month: December 2019

PowerShell: Quick 1-Liner to Check Status of URL

The kommand: Invoke-WebRequest "https://blog.kimconnect.com" -MaximumRedirection 0 -ErrorAction SilentlyContinue | Select-Object StatusCode,StatusDescription Sample Result: StatusCode StatusDescription----------…

PowerShell: Generate a CSV Report of O365 Exchange Online Mailboxes

# Office 365 Global Admin Credential$username="[email protected]"$password=ConvertTo-securestring "PASSWORD" -AsPlainText -Force$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username,$passwordfunction…

PowerShell: Connect to Office 365 Exchange Online

function disconnectExchangeOnline{ <# manually check sessions PS C:\Windows\system32> Get-PSSession Id Name ComputerName ComputerType State ConfigurationName…

PowerShell: Get Executable Version and File Location

# Quick method to obtain computernames of all nodes in a cluster and adjoin result…

PowerShell: Add System Backup Privileges

function addSystemPrivilege{ param( [String[]]$privileges=@("SeBackupPrivilege","SeRestorePrivilege") ) function includeSystemPrivileges{ $win32api = @' using System; using System.Runtime.InteropServices; namespace…

PowerShell: Enable ISE

Import-Module ServerManager;Add-WindowsFeature PowerShell-ISE

PowerShell: Deleting a Single File Safely

# Name your file$item="\\FILESHERVER007\someweird folder names with long paths\ fmmkklghhbb-yj-yuyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy p-hphlfiles\whatup.exe - Shortcut.lnk" #item could…