Screenconnect Toolbox Useful Commands
 Share
The version of the browser you are using is no longer supported. Please upgrade to a supported browser.Dismiss

Comment only
 
ABCDEFGH
1
5/15/2018 Send me a message (silversword at gmail com) if you'd like to be able to add/edit this sheet. Due to abuse Anonymous editing has been disabled.
2
ScreenConnect CommandsUse with Toolbox found at: https://help.screenconnect.com/Extension:Command_Toolbox
3
XP/VistaWin7/8/10OSXLinuxCategoryWhat it doesCommand
4
YesYesNoNoCommandRebootshutdown /r /f /t 0
5
YesYesNoNoCommandForce Shutdownshutdown /s /f /t 0
6
YesNoNoCommandGroup Policy Update#!ps
#timeout=90000
gpupdate /force
7
YesYesNoNoDiskSchedule chkdsk c: /f and reboot echo y|chkdsk c: /f /x & shutdown /r /f
8
YesYesNoNoDiskSchedule chkdsk c: /r and reboot immediatelyecho y|chkdsk c: /f /r /x & shutdown /r /f /t 00
9
YesYesNoNoDiskGet drive space and size, all driveswmic logicaldisk get freespace,size,caption
10
YesYesNoNoDiskList shadow copies and storage allocation for System Restorevssadmin list shadowstorage
11
YesYesNoNoDiskList Disks In system#!ps
Get-PhysicalDisk
12
YesYesNoNoDiskList SMART Read Errors/Write Errors/Temp#!ps
Get-PhysicalDisk | Get-StorageReliabilityCounter| Select-Object ReadErrorsTotal, WriteErrorsTotal, Temperature
13
NoYesNoNoFun StuffHave computer speak using voice synthesis
powershell Add-Type -AssemblyName System.speech; $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer; $speak.Speak('Hello there. This is your computer.?')
14
YesYesNoNoNetworkingipconfigipconfig
15
YesYesNoNoNetworkingipconfig - show full detailsipconfig /all
16
YesYesNoNoNetworkingClears out cached DNS resultsipconfig /flushdns
17
YesYesNoNoNetworkingrebuild TCP stack (requires reboot after)netsh int ip reset c:\tcpreset.txt
18
NoNoYesNoNetworkingGet list of network services in order of preference;
example output:

An asterisk (*) denotes that a network service is disabled.
(1) Ethernet
(Hardware Port: Ethernet, Device: en0)

(2) Wi-Fi
(Hardware Port: Wi-Fi, Device: en1)

(3) Bluetooth PAN
(Hardware Port: Bluetooth PAN, Device: en4)

(4) Thunderbolt Bridge
(Hardware Port: Thunderbolt Bridge, Device: bridge0)
networksetup -listnetworkserviceorder
19
NoNoYesNoNetworkingSet order of network services;
in this example, Wi-Fi is preferred
networksetup -ordernetworkservices Wi-Fi Ethernet "Bluetooth PAN" "Thunderbolt Bridge"
20
YesYesNoNoOtherInstall Chocolatey ( you must restart screenconnect service after installed )
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
21
YesYesNoNoOtherInstall Chocolatey Package ( https://chocolatey.org/packages )choco install googlechrome -y
22
YesNoNoOtherDownload file and put it somewherepowershell -command "(new-object System.Net.WebClient).DownloadFile('http://i.imgur.com/wvunc.jpg','C:\Temp\CatLord.jpg')"
23
YesYesNoNoOtherExtract Filespowershell -Command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('yourfile.zip', 'c:\your\destination'); }"
24
YesYesNoNoOtherCompress Filespowershell -Command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::CreateFromDirectory('SOURCEFOLDER', 'DESTINATION.ZIP'); }"
25
YesNoNoOtherAdd registry key to Win10 to disable Suggested Appsreg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows /v DisableWindowsConsumerFeatures /t REG_DWORD /d 00000001 /f
26
YesYesNoNoPrintersList Printerscscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -l
27
YesYesNoNoScreenConnectSet unattended service to auto-restart every 60 seconds (you have to replace xxx-unique-ID with your custom service name)sc failure "ScreenConnect Client (xxxx-unique-ID)" actions= restart/60000/restart/60000/restart/60000/ reset= 60
28
YesYesNoNoScreenConnectRemove ScreenConnect DelayStart (you have to replace xxx-unique-ID with your custom service name)sc config "ScreenConnect Client (xxxx-unique-ID)" start= auto
29
YesYesNoNoScreenConnectSet ScreenConnect DelayStart (you have to replace xxx-unique-ID with your custom service name)sc config "ScreenConnect Client (xxxx-unique-ID)" start= delayed-auto
30
YesYesNoNoScreenConnectstop/start screenconnect service run from bat file (I'll execute it, then put on the desktop so I can talk a user thru running it)net stop "ScreenConnect Client (xxxx-unique-ID)" & net start "ScreenConnect Client (xxxx-unique-ID)"
31
YesNoNoSystem InfoInstalled Programs#!ps
#timeout=60000
#!ps Get-WmiObject -Class Win32_Product | Select-Object -Property Name | Sort-Object Name
32
YesYesNoNoSystem InfoFind uptime and x32/x64 in systeminfosysteminfo | findstr /c:"System" OR net statistics workstation | find /i "statistics since" (quite quick)
33
YesYesNoNoSystem InfoGet PC Infowmic computersystem get model,name,manufacturer,systemtype,totalphysicalmemory,partofdomain,domain,workgroup,username
Alternative: http://forum.screenconnect.com/yaf_postst9419_Extension--Additional-General-Information.aspx#post33041
34
YesYesNoNoSystem InfoGet Svc Tagwmic csproduct get vendor,name,identifyingnumber
Alternative: http://forum.screenconnect.com/yaf_postst9419_Extension--Additional-General-Information.aspx#post33042
35
YesYesNoNoSystem InfoGet System Serial #wmic bios get serialnumber
Alternative: http://forum.screenconnect.com/yaf_postst9419_Extension--Additional-General-Information.aspx#post33043
36
YesYesNoNoSystem InfoGet Screen Resolutionwmic desktopmonitor get screenheight, screenwidth
37
YesYesNoNoSystem InfoGet CPU loadwmic cpu get loadpercentage
38
YesNoNoSystem InfoGet Battery chargeWMIC PATH Win32_Battery Get EstimatedChargeRemaining
39
YesYesNoNoSystem InfoCheck service statussc query [servicename] | findstr /i "STATE"
40
YesYesNoNoSystem InfoCheck System Restore status and allocation levelsvssadmin list shadowstorage
42
YesYesNoNoSystem InfoSet c: System Restore max size to 50GBvssadmin resize shadowstorage /for=C: /on=C: /maxsize=50GB
47
NoYesNoNoWifiShow wireless connection signal strength for connected networknetsh WLAN show interfaces
48
NoYesNoNoWifiShow wireless profiles (especially useful in win8 with no manage wireless)netsh wlan show profiles
49
NoYesNoNoWifiErase all wireless profiles (CAREFUL!!!)netsh wlan delete profile name=* i=*
50
YesYesNoNoWifiGet Signal Strength For Visible Wifi's#timeout=720000
#maxlength=10000
netsh wlan show networks mode=bssid
51
NoNoYesNoWifiJoin a given SSID (en1 is the Wi-Fi port)networksetup -setairportnetwork en1 ExampleSSID ExamplePASSWORD
52
NoNoYesNoWifi"Forget" a given Wi-Fi SSIDnetworksetup -removepreferredwirelessnetwork en1 ExampleSSID
53
54
55
56
57
YesNoNoNetworkingDownload speed test (Simple)
#!ps
#timeout=60000
"{0:N2} Mbit/sec" -f ((10/(Measure-Command {Invoke-WebRequest 'http://client.akamai.com/install/test-objects/100MB.bin'|Out-Null}).TotalSeconds)*8)
58
YesNoNoNetworkingDownload speed test (Complex)
#!ps
#timeout=60000
Function downloadSpeed($strUploadUrl)
{
$topServerUrlSpilt = $strUploadUrl -split 'upload'
$url = $topServerUrlSpilt[0] + 'random2000x2000.jpg'
$col = new-object System.Collections.Specialized.NameValueCollection
$wc = new-object system.net.WebClient
$wc.QueryString = $col
$downloadElaspedTime = (measure-command {$webpage1 = $wc.DownloadData($url)}).totalmilliseconds
$string = [System.Text.Encoding]::ASCII.GetString($webpage1)
$downSize = ($webpage1.length + $webpage2.length) / 1Mb
$downloadSize = [Math]::Round($downSize, 2)
$downloadTimeSec = $downloadElaspedTime * 0.001
$downSpeed = ($downloadSize / $downloadTimeSec) * 8
$downloadSpeed = [Math]::Round($downSpeed, 2)
return $downloadSpeed
}

<#
Using this method to make the submission to speedtest. Its the only way i could figure out how to interact with the page since there is no API.
More information for later here: https://support.microsoft.com/en-us/kb/290591
#>
$objXmlHttp = New-Object -ComObject MSXML2.ServerXMLHTTP
$objXmlHttp.Open("GET", "http://www.speedtest.net/speedtest-config.php", $False)
$objXmlHttp.Send()

#Retrieving the content of the response.
[xml]$content = $objXmlHttp.responseText

<#
Gives me the Latitude and Longitude so i can pick the closer server to me to actually test against. It doesnt seem to automatically do this.
Lat and Longitude for tampa at my house are $orilat = 27.9238 and $orilon = -82.3505
This is corroborated against: http://www.travelmath.com/cities/Tampa,+FL - It checks out.
#>
$oriLat = $content.settings.client.lat
$oriLon = $content.settings.client.lon

#Making another request. This time to get the server list from the site.
$objXmlHttp1 = New-Object -ComObject MSXML2.ServerXMLHTTP
$objXmlHttp1.Open("GET", "http://www.speedtest.net/speedtest-servers.php", $False)
$objXmlHttp1.Send()

#Retrieving the content of the response.
[xml]$ServerList = $objXmlHttp1.responseText

<#
$Cons contains all of the information about every server in the speedtest.net database.
I was going to filter this to US servers only which would speed this up a lot but i know we have overseas partners we run this against.
Results returned look like this for each individual server:

url : http://speedtestnet.rapidsys.com/speedtest/upload.php
lat : 27.9709
lon : -82.4646
name : Tampa, FL
country : United States
cc : US
sponsor : Rapid Systems
id : 1296

#>
$cons = $ServerList.settings.servers.server

#Below we calculate servers relative closeness to you by doing some math against latitude and longitude.
foreach($val in $cons)
{
$R = 6371;
[float]$dlat = ([float]$oriLat - [float]$val.lat) * 3.14 / 180;
[float]$dlon = ([float]$oriLon - [float]$val.lon) * 3.14 / 180;
[float]$a = [math]::Sin([float]$dLat/2) * [math]::Sin([float]$dLat/2) + [math]::Cos([float]$oriLat * 3.14 / 180 ) * [math]::Cos([float]$val.lat * 3.14 / 180 ) * [math]::Sin([float]$dLon/2) * [math]::Sin([float]$dLon/2);
[float]$c = 2 * [math]::Atan2([math]::Sqrt([float]$a ), [math]::Sqrt(1 - [float]$a));
[float]$d = [float]$R * [float]$c;

$ServerInformation +=
@([pscustomobject]@{Distance = $d; Country = $val.country; Sponsor = $val.sponsor; Url = $val.url })

}

$serverinformation = $serverinformation | Sort-Object -Property distance

#Runs the functions 4 times and takes the highest result.
$DLResults1 = downloadSpeed($serverinformation[0].url)
$SpeedResults += @([pscustomobject]@{Speed = $DLResults1;})

$DLResults2 = downloadSpeed($serverinformation[1].url)
$SpeedResults += @([pscustomobject]@{Speed = $DLResults2;})

$DLResults3 = downloadSpeed($serverinformation[2].url)
$SpeedResults += @([pscustomobject]@{Speed = $DLResults3;})

$DLResults4 = downloadSpeed($serverinformation[3].url)
$SpeedResults += @([pscustomobject]@{Speed = $DLResults4;})

$UnsortedResults = $SpeedResults | Sort-Object -Property speed
$WanSpeed = $UnsortedResults[3].speed
Write-Host "Wan Speed is $($Wanspeed) Mbit/Sec"
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Loading...