forked from christaylorcodes/ConnectWiseControlAPI
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBasic.ps1
More file actions
23 lines (16 loc) · 630 Bytes
/
Basic.ps1
File metadata and controls
23 lines (16 loc) · 630 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Your Control server URL
$Server = 'control.domain.com'
# Get Control credentials
$Credentials = Get-Credential
# Load module
Install-Module 'ConnectWiseControlAPI'
Import-Module 'ConnectWiseControlAPI'
# Save connection info
Connect-CWC -Server $Server -Credentials $Credentials
# Find this machine in Control
$Computer = Get-CWCSession -Type Access -Search $env:COMPUTERNAME -Limit 1
if(!$Computer){ return "Computer not found" }
# We now have some basic information about this session
$Computer
# We can use this to issue other command like getting the machines last contact
Get-CWCLastContact -GUID $Computer.SessionID