Welcome to the ConnectWise Control Remote Powershell Commands PT 3. 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
 

List Hard Drive Manufacturer Information

#!ps
#maxlength=50000
#timeout=9000000
wmic diskdrive get Name"," Manufacturer"," Model"," InterfaceType"," MediaType"," SerialNumber
 

List Drive Letters

#!ps
#maxlength=50000
#timeout=9000000
wmic logicaldisk get size,freespace,caption
 

Show Disk Errors

#!ps
#maxlength=50000
#timeout=9000000
Get-EventLog -Newest 10 -LogName "System" -EntryType Error -Source "Ntfs" | select -ExpandProperty message;
Get-EventLog -Newest 10 -LogName "System" -EntryType Error -Source "Disk" | select -ExpandProperty message

Show Network Connection Profile

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

Show Max CPU Speed

#!ps
#maxlength=50000
#timeout=9000000
Get-CimInstance Win32_Processor | Select-Object -Expand MaxClockSpeed
 

Trusted Platform Module (TPM)

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

Check BitLocker Volume

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

Disable BitLocker

#!ps
#maxlength=50000
#timeout=9000000
$BLV = Get-BitLockerVolume;
Disable-BitLocker -MountPoint $BLV
 

BitLocker Auto Unlock

#!ps
#maxlength=50000
#timeout=9000000
Clear-BitLockerAutoUnlock

Check BitLocker Status

#!ps
#maxlength=50000
#timeout=9000000
manage-bde -status
 

Show WiFi Connection

#!ps
#maxlength=50000
#timeout=9000000
netsh wlan show networks mode=bssid
 

Display Local Users

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

List Installed Software and Output to a File

Get 64 bit software
#!ps
#maxlength=50000
#timeout=9000000
$data = dir HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | where {$_.name -notmatch '(\.)?KB\d+'} -pv p | Get-ItemProperty | Where {$_.displayname -notmatch "KB\d{5,}"} | Select @{Name="Path";Expression={$p.name}},DisplayName,DisplayVersion,Publisher,InstallDate | Out-file c:\temp\output64.txt
 
Get 32 bit software
#!ps
#maxlength=50000
#timeout=9000000
dir HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall -PipelineVariable p | Get-ItemProperty | Select @{Name="Path";Expression={$p.name}},DisplayName,DisplayVersion,Publisher,InstallDate | Out-file c:\temp\output32.txt

Get Serial Number

#!ps
#maxlength=50000
#timeout=9000000
wmic bios get serialnumber
 

Force Group Policy

#!ps
#maxlength=50000
#timeout=9000000
gpupdate /force
 

Turn Off Firewall & Enable Network Discovery

netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes
 

 
NetSh Advfirewall set allprofiles state off
 

Make Workstation Speak

#!ps
#maxlength=50000
#timeout=9000000
powershell Add-Type -AssemblyName System.speech; $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer; $speak.Speak('Help me, I am stuck')

Conclusion

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


Questions, comments, want to point out errors or just want to say Hi? Please fill out the contact form below.

4/22/2021 - ConnectWise Control Remote PowerShell Commands
4/25/2021 - ConnectWise Control Remote PowerShell Commands PT 2
5/10/2021 - ConnectWise Control Remote PowerShell Commands PT 3
5/18/2021 - ConnectWise Control Remote PowerShell Commands PT 4
6/03/2021 - ConnectWise Control Remote PowerShell Commands PT 5

First Name:

About Wade

I am dedicated and accomplished application developer and multi-hat information system administrator and manager. Extensive background with the full lifecycle of hardware with systems, devices, networks, databases and software development while ensuring optimal performance.
 
WadeBach.com

Last Name:
Email:
Message: