Screenconnect commandline

From SWKLS WIKI
Revision as of 14:13, 13 March 2020 by Unknown user (talk)
Jump to navigation Jump to search

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 (copy into 'Run Command' dialog)

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