irm 'https://bit.ly/controlposh' | iex
Get-CWCLastContact
SYNOPSIS
Returns the date the machine last connected to the server.
SYNTAX
Get-CWCLastContact [-Server] <Object> [-GUID] <Object> [-User] <Object> [-Password] <Object> [<CommonParameters>]
DESCRIPTION
PARAMETERS
-Server <Object>
The address to your Control server. Example 'https://control.labtechconsulting.com' or 'http://control.secure.me:8040'
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-GUID <Object>
The GUID identifier for the machine you wish to connect to. No documentation on how to find the GUID but it is in the URL and service.
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-User <Object>
User to authenticate against the Control server.
Required? true
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Password <Object>
Password to authenticate against the Control server.
Required? true
Position? 4
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Quiet <Object>
Will output a boolean result, $True for Connected or $False for Offline.
Required? false
Position? 5
Default value false
Accept pipeline input? false
Accept wildcard characters? false
-Seconds <Object>
Used with Quiet switch. The number of seconds a machine needs to be offline before returning $False.
Required? false
Position? 6
Default value
Accept pipeline input? false
Accept wildcard characters? false
INPUTS
OUTPUTS
[datetime]
NOTES
Version: 1.0
Author: Chris Taylor
Creation Date: 1/20/2016
Purpose/Change: Initial script development
EXAMPLES
EXAMPLE 1
Get-CWCLastContact -Server $Server -GUID $GUID -User $User -Password $Password
Will return the last contact of the machine with that GUID.
Invoke-CWCCommand
SYNOPSIS
Will issue a command against a given machine and return the results.
SYNTAX
Invoke-CWCCommand [-Server] <Object> [-GUID] <Object> [-User] <Object> [-Password] <Object> [[-Command] <Object>] [[-TimeOut] <Object>] [<CommonParameters>]
DESCRIPTION
PARAMETERS
-Server <Object>
The address to your Control server. Example 'https://control.labtechconsulting.com' or 'http://control.secure.me:8040'
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-GUID <Object>
The GUID identifier for the machine you wish to connect to. No documentation on how to find the GUID but it is in the URL and service.
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-User <Object>
User to authenticate against the Control server.
Required? true
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Password <Object>
Password to authenticate against the Control server.
Required? true
Position? 4
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Command <Object>
The command you wish to issue to the machine.
Required? false
Position? 5
Default value
Accept pipeline input? false
Accept wildcard characters? false
-TimeOut <Object>
The amount of time in milliseconds that a command can execute before it is killed.
Required? false
Position? 6
Default value 10000
Accept pipeline input? false
Accept wildcard characters? false
INPUTS
OUTPUTS
The output of the Command provided.
NOTES
Version: 1.0
Author: Chris Taylor
Creation Date: 1/20/2016
Purpose/Change: Initial script development
EXAMPLES
EXAMPLE 1
Invoke-CWCCommand -Server $Server -GUID $GUID -User $User -Password $Password -Command 'hostname'
Will return the hostname of the machine.
EXAMPLE 2
Invoke-CWCCommand -Server $Server -GUID $GUID -User $User -Password $Password -TimeOut 120000 -Command 'powershell "iwr https://bit.ly/ltposh | iex; Restart-LTService"'
Will restart the Automate agent on the target machine.