Welcome to the ConnectWise Control Remote Powershell Commands PT 2. They are my other go to remote commands. Some commands will need extra configuration or tweaking depending on your environment. The others are cut and paste. Enjoy!

PowerShell & Command Prompt Commands

The commands are either PowerShell (#!ps) or Command Prompt (#!cmd) commands. There are a couple attributes that affect how the commands respond.

#MaxLength - The max length of output characters. Some may need to be larger due to amount of output data.
#TimeOut - The period of time the command can run and will be terminated after the max has been hit. Most commands are quick to respond.

SUCCESS or FAILURE
The Command Prompt commands should work fine however the PowerShell commands may fail due to the set level of running commands remote.
"ps cannot be loaded because the execution of scripts is disabled or restricted on this system."
Let's set the execution policy.

Check Execution Policy

#!ps
#maxlength=50000
#timeout=9000000
Get-ExecutionPolicy
 

Set Execution Policy to Unrestricted

#!ps
#maxlength=50000
#timeout=9000000
Set-ExecutionPolicy Unrestricted
 

Ping

#!ps
#maxlength=50000
#timeout=9000000
ping Google.com

Trace Route

#!ps
#maxlength=50000
#timeout=9000000
tracert Google.com

Install PowerShellGet

#!ps
#maxlength=50000
#timeout=9000000
Install-Module -Name PowerShellGet -Force

Get Package Providers

#!ps
#maxlength=50000
#timeout=9000000
Get-PackageProvider -ListAvailable
 

Find Port Owning Process

#!ps
#maxlength=50000
#timeout=9000000
Get-Process -Id (Get-NetTCPConnection -LocalPort <PORT>).OwningProcess
Get-Process -Id (Get-NetUDPEndpoint -LocalPort <PORT>).OwningProcess
 

Check Power Settings

#!ps
#maxlength=50000
#timeout=9000000
powercfg -query
 

Disable Hibernation and Turn off Power Settings

#!ps
#maxlength=50000
#timeout=9000000
powercfg.exe /h off
powercfg /x -disk-timeout-ac 0
powercfg /x -disk-timeout-dc 0
powercfg /x -monitor-timeout-ac 0
powercfg /x -monitor-timeout-dc 0
Powercfg /x -standby-timeout-ac 0
powercfg /x -standby-timeout-dc 0
powercfg /x -hibernate-timeout-ac 0
powercfg /x -hibernate-timeout-dc 0
 

Misc Power Commands

#!ps
#maxlength=50000
#timeout=9000000
powercfg -LIST
 
#!ps
#maxlength=50000
#timeout=9000000
gpresult /Scope User /v
 
#!ps
#maxlength=50000
#timeout=9000000
powercfg /sleepstudy
 
#!ps
#maxlength=50000
#timeout=9000000
powercfg -aliases

Windows Defender Commands

#!ps
#maxlength=50000
#timeout=9000000
Get-Command -Module Defender
 
#!ps
#maxlength=50000
#timeout=9000000
Update-MpSignature
 
#!ps
#maxlength=50000
#timeout=9000000
Get-MpComputerStatus
 
#!ps
#maxlength=50000
#timeout=9000000
Get-service Windefend
 
#!ps
#maxlength=50000
#timeout=9000000
Start-MpScan -ScanType QuickScan

Enable Linked Connections

#!ps
#maxlength=50000
#timeout=9000000
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -PropertyType DWORD -Name 'EnableLinkedConnections' -Value 1

Get App Packages

#!ps
#maxlength=50000
#timeout=9000000
Get-AppxPackage
 

List Fonts

#!ps
#maxlength=50000
#timeout=9000000
Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts'
 

Sophos Scan & Update

#!ps
#maxlength=50000
#timeout=9000000
$Sophos = "C:\Program Files (x86)\Sophos\Sophos Anti-Virus\sav32cli.exe"
$Arguments = "-remove"
Start-Process $Sophos -ArgumentList $Arguments -NoNewWindow -Wait
 

 
#!ps
#maxlength=50000
#timeout=9000000
$sophos = New-Object -ComObject "activelinkclient.clientupdate.1"
$sophos.updatenow($true,1)
 

Rename Workstation

#!ps
#maxlength=50000
#timeout=9000000
WMIC computersystem where caption='OLDName' rename NEWNAME

Enable TLS in Commands

#!ps
#maxlength=50000
#timeout=9000000
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
<Commands>
 

Conclusion

There you go! These are the remote commands that help me with my day to day MSP life.