Screenconnect commandline: Difference between revisions

From SWKLS WIKI
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{Sidebar
| style =
| name = ScreenConnect
| pretitle =
| title = Command Line Notes
| heading1 = CMD
| content1 = blah blah
| heading2 = Powershell
| content2= blah blah
}}
==Enable Remote Execution==
==Enable Remote Execution==
<syntaxhighlight lang="powershell" line='line'>Set-ExecutionPolicy RemoteSigned</syntaxhighlight>
<syntaxhighlight lang="powershell" line='line'>Set-ExecutionPolicy RemoteSigned</syntaxhighlight>

Revision as of 20:19, 13 March 2020

Template:Sidebar

Enable Remote Execution

Set-ExecutionPolicy RemoteSigned

Show Processes Names Like sam* and Filter for name only

Get-Process sam* | Select-object name

Test if Service is Running

(Get-Service -Name 'Spooler').Status -eq 'Running'

Show Drives and Space Usage

get-psdrive -psprovider filesystem

Create a Desktop shortcut to a folder

$TargetFile = "C:\scan\"
$ShortcutFile = "$env:Public\Desktop\folder.lnk"
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)
$Shortcut.TargetPath = $TargetFile
$Shortcut.Save()