Skip to content

Commit 0a0862d

Browse files
Merge pull request LabtechConsulting#43 from LabtechConsulting/master
Bringing base to current with primary repository.
2 parents 56d97e9 + 35b107e commit 0a0862d

27 files changed

+107
-93
lines changed

LabTech.psm1

Lines changed: 49 additions & 91 deletions
Large diffs are not rendered by default.

LabTech/ConvertFrom-LTSecurity.md

2.58 KB

ConvertFrom-LTSecurity

SYNOPSIS

This function decodes an encoded Base64 value

SYNTAX

ConvertFrom-LTSecurity [-InputString] <String[]> [-Key <String[]>] [-Force] [<CommonParameters>]

DESCRIPTION

This function decodes the provided string using the specified or default key.

PARAMETERS

-InputString <String[]>

This is the string to be decoded.

Required                    true
Position                    2
Default value
Accept pipeline input       true (ByValue, ByPropertyName)
Accept wildcard characters  false

-Key <String[]>

This is the key used for decoding. If not provided, default values will be tried.

Required                    false
Position                    named
Default value
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-Force <SwitchParameter>

This forces the function to try alternate key values if decoding fails using provided key.

Required                    false
Position                    named
Default value                True
Accept pipeline input       false
Accept wildcard characters  false

NOTES

Version: 1.1

Author: Darren White

Creation Date: 1/25/2018

Purpose/Change: Initial function development

LabTech/ConvertTo-LTSecurity.md

1.88 KB

ConvertTo-LTSecurity

SYNOPSIS

This function encodes a value compatible with LT operations.

SYNTAX

ConvertTo-LTSecurity [-InputString] <String> [[-Key] <Object>] [<CommonParameters>]

DESCRIPTION

This function encodes the provided string using the specified or default key.

PARAMETERS

-InputString <String>

This is the string to be encoded.

Required                    true
Position                    1
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Key <Object>

This is the key used for encoding. If not provided, a default value will be used.

Required                    false
Position                    2
Default value
Accept pipeline input       false
Accept wildcard characters  false

NOTES

Version: 1.1

Author: Darren White

Creation Date: 1/25/2018

Purpose/Change: Initial function development

LabTech/Get-LTError.md

1.75 KB

Get-LTError

SYNOPSIS

This will pull the %ltsvcdir%\LTErrors.txt file into an object.

SYNTAX

Get-LTError [<CommonParameters>]

EXAMPLES

EXAMPLE 1

PS C:\>Get-LTError | where {(Get-date $_.Time) -gt (get-date).AddHours(-24)}

Get a list of all errors in the last 24hr

EXAMPLE 2

PS C:\>Get-LTError | Out-Gridview

Open the log file in a sortable searchable window.

NOTES

Version: 1.2

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 3/18/2018

Purpose/Change: Changed Erroraction from Stop to unspecified to allow caller to set the ErrorAction.

LabTech/Get-LTLogging.md

1.18 KB

Get-LTLogging

SYNOPSIS

This function will return the logging level of the LabTech service.

SYNTAX

Get-LTLogging [<CommonParameters>]

NOTES

Version: 1.1

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 3/18/2018

Purpose/Change: Changed Erroraction from Stop to unspecified to allow caller to set the ErrorAction.

LabTech/Get-LTProbeErrors.md

1.8 KB

Get-LTProbeErrors

SYNOPSIS

This will pull the %ltsvcdir%\LTProbeErrors.txt file into an object.

SYNTAX

Get-LTProbeErrors [<CommonParameters>]

EXAMPLES

EXAMPLE 1

PS C:\>Get-LTProbeErrors | where {(Get-date $_.Time) -gt (get-date).AddHours(-24)}

Get a list of all errors in the last 24hr

EXAMPLE 2

PS C:\>Get-LTProbeErrors | Out-Gridview

Open the log file in a sortable searchable window.

NOTES

Version: 1.1

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 3/18/2018

Purpose/Change: Changed Erroraction from Stop to unspecified to allow caller to set the ErrorAction.

LabTech/Get-LTProxy.md

1.76 KB

Get-LTProxy

SYNOPSIS

This function retrieves the current agent proxy settings for module functions to use the specified proxy configuration for all communication operations as long as the module remains loaded.

SYNTAX

Get-LTProxy [<CommonParameters>]

DESCRIPTION

This function will get the current LabTech Proxy settings from the installed agent (if present). If no agent settings are found, the function will attempt to discover the current proxy settings for the system. The Proxy Settings determined will be stored in memory for internal use, and returned as the function result.

NOTES

Version: 1.1

Author: Darren White

Creation Date: 1/24/2018

Purpose/Change: Initial function development

Update Date: 3/18/2018

Purpose/Change: Ensure ProxyUser and ProxyPassword are set correctly when proxy

is not configured.

LabTech/Get-LTServiceInfo.md

2.31 KB

Get-LTServiceInfo

SYNOPSIS

This function will pull all of the registry data into an object.

SYNTAX

Get-LTServiceInfo [-WhatIf] [-Confirm] [<CommonParameters>]

PARAMETERS

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

NOTES

Version: 1.4

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 8/24/2017

Purpose/Change: Update to use Clear-Variable.

Update Date: 3/12/2018

Purpose/Change: Support for ShouldProcess to enable -Confirm and -WhatIf.

Update Date: 8/28/2018

Purpose/Change: Remove '~' from server addresses.

LabTech/Get-LTServiceInfoBackup.md

1.23 KB

Get-LTServiceInfoBackup

SYNOPSIS

This function will pull all of the backed up registry data into an object.

SYNTAX

Get-LTServiceInfoBackup [<CommonParameters>]

NOTES

Version: 1.1

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 5/11/2017

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 3/18/2018

Purpose/Change: Changed Erroraction from Stop to unspecified to allow caller to set the ErrorAction.

LabTech/Get-LTServiceSettings.md

1.02 KB

Get-LTServiceSettings

SYNOPSIS

This function will pull the registry data from HKLM:\SOFTWARE\LabTech\Service\Settings into an object.

SYNTAX

Get-LTServiceSettings [<CommonParameters>]

NOTES

Version: 1.1

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

LabTech/Hide-LTAddRemove.md

2.41 KB

Hide-LTAddRemove

SYNOPSIS

This function hides the LabTech install from the Add/Remove Programs list.

SYNTAX

Hide-LTAddRemove [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This function will rename the DisplayName registry key to hide it from the Add/Remove Programs list.

PARAMETERS

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

NOTES

Version: 1.2

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 3/12/2018

Purpose/Change: Support for ShouldProcess. Added Registry Paths to be checked.

Modified hiding method to be compatible with standard software controls.

LabTech/Install-LTService.md

10.3 KB

Install-LTService

SYNOPSIS

This function will install the LabTech agent on the machine.

SYNTAX

Install-LTService [-Server] <String[]> [[-ServerPassword] <String>] [[-LocationID] <Int32>] [[-TrayPort] <Int32>] [[-Rename] <String>] [-Hide] [-SkipDotNet] [-Force] [-NoWait] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This function will install the LabTech agent on the machine with the specified server/password/location.

PARAMETERS

-Server <String[]>

This is the URL to your LabTech server.

example: https://lt.domain.com

This is used to download the installation files.

(Get-LTServiceInfo|Select-Object -Expand 'Server Address' -ErrorAction SilentlyContinue)

Required                    true
Position                    1
Default value
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-ServerPassword <String>

Required                    false
Position                    2
Default value
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-LocationID <Int32>

This is the LocationID of the location that the agent will be put into.

(Get-LTServiceInfo).LocationID

Required                    false
Position                    3
Default value                0
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-TrayPort <Int32>

This is the port LTSvc.exe listens on for communication with LTTray processess.

Required                    false
Position                    4
Default value                0
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-Rename <String>

This will call Rename-LTAddRemove after the install.

Required                    false
Position                    5
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Hide <SwitchParameter>

This will call Hide-LTAddRemove after the install.

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-SkipDotNet <SwitchParameter>

This will disable the error checking for the .NET 3.5 and .NET 2.0 frameworks during the install process.

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-Force <SwitchParameter>

This will disable some of the error checking on the install process.

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-NoWait <SwitchParameter>

This will skip the ending health check for the install process.

The function will exit once the installer has completed.

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

EXAMPLES

EXAMPLE 1

PS C:\>Install-LTService -Server https://lt.domain.com -Password sQWZzEDYKFFnTT0yP56vgA== -LocationID 42

This will install the LabTech agent using the provided Server URL, Password, and LocationID.

NOTES

Version: 1.8

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 6/10/2017

Purpose/Change: Updates for pipeline input, support for multiple servers

Update Date: 6/24/2017

Purpose/Change: Update to detect Server Version and use updated URL format for LabTech 11 Patch 13.

Update Date: 8/24/2017

Purpose/Change: Update to use Clear-Variable. Additional Debugging.

Update Date: 8/29/2017

Purpose/Change: Additional Debugging.

Update Date: 9/7/2017

Purpose/Change: Support for ShouldProcess to enable -Confirm and -WhatIf.

Update Date: 1/26/2018

Purpose/Change: Added support for Proxy Server for Download and Installation steps.

Update Date: 2/13/2018

Purpose/Change: Added -TrayPort parameter.

Update Date: 3/13/2018

Purpose/Change: Added -NoWait parameter.

Added minimum size requirement for agent installer to detect and skip a bad file download.

Update Date: 6/5/2018

Purpose/Change: Added -SkipDotNet parameter.

Allows for skipping of .NET 3.5 and 2.0 framework checks for installing on OS with .NET 4.0+ already installed

LabTech/Invoke-LTServiceCommand.md

2.7 KB

Invoke-LTServiceCommand

SYNOPSIS

This function tells the agent to execute the desired command.

SYNTAX

Invoke-LTServiceCommand [-Command] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This function will allow you to execute all known commands against an agent.

PARAMETERS

-Command <String[]>

Required                    true
Position                    2
Default value
Accept pipeline input       true (ByValue)
Accept wildcard characters  false

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

NOTES

Version: 1.2

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 2/2/2018

Purpose/Change: Initial script development

Thanks: Gavin Stone, for finding the command list

Update Date: 2/8/2018

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 3/21/2018

Purpose/Change: Removed ErrorAction Override

LabTech/New-LTServiceBackup.md

1.54 KB

New-LTServiceBackup

SYNOPSIS

This function will backup all the reg keys to 'HKLM\SOFTWARE\LabTechBackup' This will also backup those files to "$((Get-LTServiceInfo).BasePath)Backup"

SYNTAX

New-LTServiceBackup [<CommonParameters>]

NOTES

Version: 1.4

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 5/11/2017

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 6/7/2017

Purpose/Change: Updated error handling.

Update Date: 8/24/2017

Purpose/Change: Update to use Clear-Variable.

Update Date: 3/21/2017

Purpose/Change: Added additional Debug Output

LabTech/Redo-LTService.md

8.46 KB

Redo-LTService

SYNOPSIS

This function will reinstall the LabTech agent from the machine.

SYNTAX

Redo-LTService [[-Server] <String[]>] [[-ServerPassword] <String>] [[-LocationID] <String>] [-Backup] [-Hide] [[-Rename] <String>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This script will attempt to pull all current settings from machine and issue an 'Uninstall-LTService', 'Install-LTService' with gathered information. If the function is unable to find the settings it will ask for needed parameters.

PARAMETERS

-Server <String[]>

This is the URL to your LabTech server.

Example: https://lt.domain.com

This is used to download the installation and removal utilities.

If no server is provided the uninstaller will use Get-LTServiceInfo to get the server address.

If it is unable to find LT currently installed it will try Get-LTServiceInfoBackup

Required                    false
Position                    1
Default value
Accept pipeline input       true (ByValue, ByPropertyName)
Accept wildcard characters  false

-ServerPassword <String>

Required                    false
Position                    2
Default value
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-LocationID <String>

The LocationID of the location that you want the agent in

example: 555

Required                    false
Position                    3
Default value
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-Backup <SwitchParameter>

This will run a New-LTServiceBackup command before uninstalling.

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-Hide <SwitchParameter>

Will remove from add-remove programs

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-Rename <String>

This will call Rename-LTAddRemove to rename the install in Add/Remove Programs

Required                    false
Position                    4
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Force <SwitchParameter>

This will force operation on an agent detected as a probe.

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

EXAMPLES

EXAMPLE 1

PS C:\>Redo-LTService

This will ReInstall the LabTech agent using the server address in the registry.

EXAMPLE 2

PS C:\>Redo-LTService -Server https://lt.domain.com -Password sQWZzEDYKFFnTT0yP56vgA== -LocationID 42

This will ReInstall the LabTech agent using the provided server URL to download the installation files.

NOTES

Version: 1.5

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 6/8/2017

Purpose/Change: Update to support user provided settings for -Server, -Password, -LocationID.

Update Date: 6/10/2017

Purpose/Change: Updates for pipeline input, support for multiple servers

Update Date: 8/24/2017

Purpose/Change: Update to use Clear-Variable.

Update Date: 3/12/2018

Purpose/Change: Added detection of "Probe" enabled agent.

Added support for -Force parameter to override probe detection.

Updated support of -WhatIf parameter.

LabTech/Rename-LTAddRemove.md

3.49 KB

Rename-LTAddRemove

SYNOPSIS

This function renames the LabTech install as shown in the Add/Remove Programs list.

SYNTAX

Rename-LTAddRemove [-Name] <Object> [[-PublisherName] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This function will change the value of the DisplayName registry key to effect Add/Remove Programs list.

PARAMETERS

-Name <Object>

This is the Name for the LabTech Agent as displayed in the list of installed software.

Required                    true
Position                    1
Default value
Accept pipeline input       false
Accept wildcard characters  false

-PublisherName <String>

This is the Name for the Publisher of the LabTech Agent as displayed in the list of installed software.

Required                    false
Position                    2
Default value
Accept pipeline input       false
Accept wildcard characters  false

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

NOTES

Version: 1.2

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 5/14/2017

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 3/12/2018

Purpose/Change: Support for ShouldProcess to enable -Confirm and -WhatIf.

LabTech/Reset-LTService.md

6.49 KB

Reset-LTService

SYNOPSIS

This function will remove local settings on the agent.

SYNTAX

Reset-LTService [-ID] [-Location] [-MAC] [-Force] [-NoWait] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This function can remove some of the agents local settings. ID, MAC, LocationID The function will stop the services, make the change, then start the services. Resetting all of these will force the agent to check in as a new agent. If you have MAC filtering enabled it should check back in with the same ID. This function is useful for duplicate agents.

PARAMETERS

-ID <SwitchParameter>

This will reset the AgentID of the computer

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-Location <SwitchParameter>

This will reset the LocationID of the computer

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-MAC <SwitchParameter>

This will reset the MAC of the computer

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-Force <SwitchParameter>

This will force operation on an agent detected as a probe.

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-NoWait <SwitchParameter>

This will skip the ending health check for the reset process.

The function will exit once the values specified have been reset.

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

EXAMPLES

EXAMPLE 1

PS C:\>Reset-LTService

This resets the ID, MAC and LocationID on the agent.

EXAMPLE 2

PS C:\>Reset-LTService -ID

This resets only the ID of the agent.

NOTES

Version: 1.3

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 3/12/2018

Purpose/Change: Added detection of "Probe" enabled agent.

Added support for -Force parameter to override probe detection. Added support for -WhatIf.

Added support for -NoWait paramter to bypass agent health check.

Update Date: 3/21/2018

Purpose/Change: Removed ErrorAction Override

LabTech/Restart-LTService.md

2.17 KB

Restart-LTService

SYNOPSIS

This function will restart the LabTech Services.

SYNTAX

Restart-LTService [-WhatIf] [-Confirm] [<CommonParameters>]

PARAMETERS

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

NOTES

Version: 1.3

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 3/13/2018

Purpose/Change: Added additional debugging output, support for ShouldProcess (-Confirm, -WhatIf)

Update Date: 3/21/2018

Purpose/Change: Removed ErrorAction Override

LabTech/Set-LTLogging.md

1.87 KB

Set-LTLogging

SYNOPSIS

This function will set the logging level of the LabTech service.

SYNTAX

Set-LTLogging [-Normal] [-Verbose] [<CommonParameters>]

PARAMETERS

-Normal <SwitchParameter>

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-Verbose <SwitchParameter>

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

NOTES

Version: 1.1

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

LabTech/Set-LTProxy.md

9.49 KB

Set-LTProxy

SYNOPSIS

This function configures module functions to use the specified proxy configuration for all operations as long as the module remains loaded.

SYNTAX

Set-LTProxy [[-ProxyServerURL] <String>] [[-ProxyUsername] <String>] [[-ProxyPassword] <String>] [-EncodedProxyUsername <String>] [-EncodedProxyPassword <String>] [-DetectProxy] [-ResetProxy] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This function will set or clear Proxy settings needed for function and agent operations. If an agent is already installed, this function will set the ProxyUsername, ProxyPassword, and ProxyServerURL values for the Agent. NOTE: Agent Services will be restarted for changes (if found) to be applied.

PARAMETERS

-ProxyServerURL <String>

This is the URL and Port to assign as the ProxyServerURL for Module

operations during this session and for the Installed Agent (if present).

Example: Set-LTProxy -ProxyServerURL 'proxyhostname.fqdn.com'

Example: Set-LTProxy -ProxyServerURL 'proxyhostname.fqdn.com:8080'

This parameter may be used with the additional following parameters:

ProxyUsername, ProxyPassword, EncodedProxyUsername, EncodedProxyPassword

Required                    false
Position                    1
Default value
Accept pipeline input       true (ByValue, ByPropertyName)
Accept wildcard characters  false

-ProxyUsername <String>

This is the plain text Username for Proxy operations.

Example: Set-LTProxy -ProxyServerURL 'proxyhostname.fqdn.com:8080' -ProxyUsername 'Test-User' -ProxyPassword 'SomeFancyPassword'

Required                    false
Position                    2
Default value
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-ProxyPassword <String>

This is the plain text Password for Proxy operations.

Required                    false
Position                    3
Default value
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-EncodedProxyUsername <String>

This is the encoded Username for Proxy operations. The parameter must be

encoded with the Agent Password. This Parameter will be decoded using the

Agent Password, and the decoded string will be configured.

NOTE: Reinstallation of the Agent will generate a new agent password.

Example: Set-LTProxy -ProxyServerURL 'proxyhostname.fqdn.com:8080' -EncodedProxyUsername '1GzhlerwMy0ElG9XNgiIkg==' -EncodedProxyPassword 'Duft4r7fekTp5YnQL9F0V9TbP7sKzm0n'

Required                    false
Position                    named
Default value
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-EncodedProxyPassword <String>

This is the encoded Password for Proxy operations. The parameter must be

encoded with the Agent Password. This Parameter will be decoded using the

Agent Password, and the decoded string will be configured.

NOTE: Reinstallation of the Agent will generate a new password.

Required                    false
Position                    named
Default value
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-DetectProxy <SwitchParameter>

This parameter attempts to automatically detect the system Proxy settings

for Module operations during this session. Discovered settings will be

assigned to the Installed Agent (if present).

Example: Set-LTProxy -DetectProxy

This parameter may not be used with other parameters.

Required                    false
Position                    named
Default value                False
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-ResetProxy <SwitchParameter>

This parameter clears any currently defined Proxy Settings for Module

operations during this session. Discovered settings will be assigned

to the Installed Agent (if present).

Example: Set-LTProxy -ResetProxy

This parameter may not be used with other parameters.

Required                    false
Position                    named
Default value                False
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

NOTES

Version: 1.1

Author: Darren White

Creation Date: 1/24/2018

Purpose/Change: Initial function development

LabTech/Show-LTAddRemove.md

2.56 KB

Show-LTAddRemove

SYNOPSIS

This function shows the LabTech install in the add/remove programs list.

SYNTAX

Show-LTAddRemove [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This function will rename the HiddenDisplayName registry key to show it in the add/remove programs list. If there is not HiddenDisplayName key the function will import a new entry.

PARAMETERS

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

NOTES

Version: 1.2

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 3/12/2018

Purpose/Change: Support for ShouldProcess. Added Registry Paths to be checked.

Modified hiding method to be compatible with standard software controls.

LabTech/Start-LTService.md

3.05 KB

Start-LTService

SYNOPSIS

This function will start the LabTech Services.

SYNTAX

Start-LTService [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This function will verify that the LabTech services are present. It will then check for any process that is using the LTTray port (Default 42000) and kill it. Next it will start the services.

PARAMETERS

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

NOTES

Version: 1.5

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 5/11/2017

Purpose/Change: added check for non standard port number and set services to auto start

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 12/14/2017

Purpose/Change: Will increment the tray port if a conflict is detected.

Update Date: 2/1/2018

Purpose/Change: Added support for -WhatIf. Added Service Control Command to request agent check-in immediately after startup.

Update Date: 3/21/2018

Purpose/Change: Removed ErrorAction Override

LabTech/Stop-LTService.md

2.49 KB

Stop-LTService

SYNOPSIS

This function will stop the LabTech Services.

SYNTAX

Stop-LTService [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This function will verify that the LabTech services are present then attempt to stop them. It will then check for any remaining LabTech processes and kill them.

PARAMETERS

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

NOTES

Version: 1.3

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 3/12/2018

Purpose/Change: Updated Support for ShouldProcess to enable -Confirm and -WhatIf parameters.

Update Date: 3/21/2018

Purpose/Change: Removed ErrorAction Override

LabTech/Test-LTPorts.md

4.4 KB

Test-LTPorts

SYNOPSIS

This function will attempt to connect to all required TCP ports.

SYNTAX

Test-LTPorts [[-Server] <String[]>] [[-TrayPort] <Int32>] [-Quiet] [<CommonParameters>]

DESCRIPTION

The function will confirm the LTTray port is available locally. It will then test required TCP ports to the Server.

PARAMETERS

-Server <String[]>

This is the URL to your LabTech server.

Example: https://lt.domain.com

If no server is provided the function will use Get-LTServiceInfo to

get the server address. If it is unable to find LT currently installed

it will try calling Get-LTServiceInfoBackup.

Required                    false
Position                    1
Default value
Accept pipeline input       true (ByValue, ByPropertyName)
Accept wildcard characters  false

-TrayPort <Int32>

This is the port LTSvc.exe listens on for communication with LTTray.

It will be checked to verify it is available. If not provided the

default port will be used (42000).

Required                    false
Position                    2
Default value                0
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-Quiet <SwitchParameter>

This will return a boolean for connectivity status to the Server

Required                    false
Position                    named
Default value                False
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

NOTES

Version: 1.6

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 5/11/2017

Purpose/Change: Quiet feature

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 6/10/2017

Purpose/Change: Updates for pipeline input, support for multiple servers

Update Date: 8/24/2017

Purpose/Change: Update to use Clear-Variable.

Update Date: 8/29/2017

Purpose/Change: Added Server Address Format Check

Update Date: 2/13/2018

Purpose/Change: Added -TrayPort parameter.

LabTech/Uninstall-LTService.md

6.66 KB

Uninstall-LTService

SYNOPSIS

This function will uninstall the LabTech agent from the machine.

SYNTAX

Uninstall-LTService [[-Server] <String[]>] [-Backup] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This function will stop all the LabTech services. It will then download the current agent install MSI and issue an uninstall command. It will then download and run Agent_Uninstall.exe from the LabTech server. It will then scrub any remaining file/registry/service data.

PARAMETERS

-Server <String[]>

This is the URL to your LabTech server.

Example: https://lt.domain.com

This is used to download the uninstall utilities.

If no server is provided the uninstaller will use Get-LTServiceInfo to get the server address.

Required                    false
Position                    1
Default value
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-Backup <SwitchParameter>

This will run a 'New-LTServiceBackup' before uninstalling.

Required                    false
Position                    named
Default value                False
Accept pipeline input       true (ByPropertyName)
Accept wildcard characters  false

-Force <SwitchParameter>

This will force operation on an agent detected as a probe.

Required                    false
Position                    named
Default value                False
Accept pipeline input       false
Accept wildcard characters  false

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

EXAMPLES

EXAMPLE 1

PS C:\>Uninstall-LTService

This will uninstall the LabTech agent using the server address in the registry.

EXAMPLE 2

PS C:\>Uninstall-LTService -Server 'https://lt.domain.com'

This will uninstall the LabTech agent using the provided server URL to download the uninstallers.

NOTES

Version: 1.5

Author: Chris Taylor

Website: labtechconsulting.com

Creation Date: 3/14/2016

Purpose/Change: Initial script development

Update Date: 6/1/2017

Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2

Update Date: 6/10/2017

Purpose/Change: Updates for pipeline input, support for multiple servers

Update Date: 6/24/2017

Purpose/Change: Update to detect Server Version and use updated URL format for LabTech 11 Patch 13.

Update Date: 8/24/2017

Purpose/Change: Update to use Clear-Variable. Modifications to Folder and Registry Delete steps. Additional Debugging.

Update Date: 1/26/2017

Purpose/Change: Added support for Proxy Server for Download and Installation steps.

Update Date: 3/12/2018

Purpose/Change: Added detection of "Probe" enabled agent.

Added support for -Force parameter to override probe detection.

Updated support of -WhatIf parameter.

Added minimum size requirement for agent installer to detect and skip a bad file download.

LabTech/Update-LTService.md

3.25 KB

Update-LTService

SYNOPSIS

This function will manually update the LabTech agent to the requested version.

SYNTAX

Update-LTService [[-Version] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This script will attempt to pull current server settings from machine, then download and run the agent updater.

PARAMETERS

-Version <String>

This is the agent version to install.

Example: 120.240

This is needed to download the update file. If omitted, the version advertised by the server will be used.

Required                    false
Position                    1
Default value
Accept pipeline input       false
Accept wildcard characters  false

-WhatIf <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

-Confirm <SwitchParameter>

Required                    false
Position                    named
Default value
Accept pipeline input       false
Accept wildcard characters  false

EXAMPLES

EXAMPLE 1

PS C:\>Update-LTService -Version 120.240

This will update the Automate agent to the specific version requested, using the server address in the registry.

EXAMPLE 2

PS C:\>Update-LTService

This will update the Automate agent to the current version advertised, using the server address in the registry.

NOTES

Version: 1.0

Author: Darren White

Creation Date: 8/28/2018

Purpose/Change: Initial function development

README.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,62 @@
1-
# LabTech-Powershell-Module
1+
# LabTech-Powershell-Module
22
This is an attempt to create a comprehensive LT PoSH module.
33
To import this module in your scripts you can run:
4-
>(new-object Net.WebClient).DownloadString('http://bit.ly/LTPoSh') | iex
4+
```
5+
(new-object Net.WebClient).DownloadString('http://bit.ly/LTPoSh') | iex
6+
```
57

68
For more information see: http://labtechconsulting.com/labtech-agent-powershell-module/
9+
10+
# Functions
11+
12+
13+
[ConvertFrom-LTSecurity](LabTech/ConvertFrom-LTSecurity.md)
14+
15+
[ConvertTo-LTSecurity](LabTech/ConvertTo-LTSecurity.md)
16+
17+
[Get-LTError](LabTech/Get-LTError.md)
18+
19+
[Get-LTLogging](LabTech/Get-LTLogging.md)
20+
21+
[Get-LTProbeErrors](LabTech/Get-LTProbeErrors.md)
22+
23+
[Get-LTProxy](LabTech/Get-LTProxy.md)
24+
25+
[Get-LTServiceInfo](LabTech/Get-LTServiceInfo.md)
26+
27+
[Get-LTServiceInfoBackup](LabTech/Get-LTServiceInfoBackup.md)
28+
29+
[Get-LTServiceSettings](LabTech/Get-LTServiceSettings.md)
30+
31+
[Hide-LTAddRemove](LabTech/Hide-LTAddRemove.md)
32+
33+
[Install-LTService](LabTech/Install-LTService.md)
34+
35+
[Invoke-LTServiceCommand](LabTech/Invoke-LTServiceCommand.md)
36+
37+
[New-LTServiceBackup](LabTech/New-LTServiceBackup.md)
38+
39+
[Redo-LTService](LabTech/Redo-LTService.md)
40+
41+
[Rename-LTAddRemove](LabTech/Rename-LTAddRemove.md)
42+
43+
[Reset-LTService](LabTech/Reset-LTService.md)
44+
45+
[Restart-LTService](LabTech/Restart-LTService.md)
46+
47+
[Set-LTLogging](LabTech/Set-LTLogging.md)
48+
49+
[Set-LTProxy](LabTech/Set-LTProxy.md)
50+
51+
[Show-LTAddRemove](LabTech/Show-LTAddRemove.md)
52+
53+
[Start-LTService](LabTech/Start-LTService.md)
54+
55+
[Stop-LTService](LabTech/Stop-LTService.md)
56+
57+
[Test-LTPorts](LabTech/Test-LTPorts.md)
58+
59+
[Uninstall-LTService](LabTech/Uninstall-LTService.md)
60+
61+
[Update-LTService](LabTech/Update-LTService.md)
62+

0 commit comments

Comments
 (0)