Day: March 8, 2022

PowerShell: Unlimit RDP Sessions

$tsRegHive='REGISTRY::HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server' Set-ItemProperty -Path $tsRegHive -Name fSingleSessionPerUser -value 0 Set-ItemProperty -Path $tsRegHive -Name fdenyTSConnections -value…

PowerShell: Install Windows Exporter

Simple Version $windowsExporterUrl='https://github.com/prometheus-community/windows_exporter/releases/download/v0.20.0/windows_exporter-0.20.0-amd64.msi' $stageFolder='C:\Temp\' # Download the file Import-Module BitsTransfer $fileName=[regex]::match($windowsExporterUrl,'[^/\\&\?]+\.\w{3,4}(?=([\?&].*$|$))') $msiFile=join-path $stageFolder $fileName if(!(test-path…

PowerShell: Check Whether an Application Is Installed Using Known Service Name

# Check whether product is installed $serviceName='windows_exporter' function checkUninstall($serviceName){ $cpuArchitecture32bitPointerSize=4 $path=if ([IntPtr]::Size -eq $cpuArchitecture32bitPointerSize) {…