-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDisable-LANDesk.ps1
38 lines (28 loc) · 999 Bytes
/
Disable-LANDesk.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<#
.SYNOPSIS
Disable LANDesk
.DESCRIPTION
No guarantees, warranties, assurances, promises, support, or licenses are granted
either explicitly or implicitly. Use at your own risk and responsibility.
#>
[CmdletBinding(SupportsShouldProcess = $true)]
param()
Import-Module (Resolve-Path $PSScriptRoot\LANDeskDefs.psm1).Path -Scope Local -Force
Import-Module (Resolve-Path $PSScriptRoot\Helpfuls.psm1).Path -Scope Local -Force
if (!(CheckRequirements 'LANDesk' $LANDeskKey))
{
return
}
$script:shouldProcess = $PSCmdLet.ShouldProcess('Testing...', '', '')
$script:changes = 0
$changes += DisableFirewallRules 'LANDesk' $shouldProcess
$changes += DisableScheduledTask $ScheduledTaskName $shouldProcess
$changes += DisableServices $ServiceNames $shouldProcess
$changes += StopRogueProcesses $InstallPath $shouldProcess
$changes += HideInstallationFolder $InstallPath $shouldProcess
if ($changes -gt 0)
{
Write-Host
Write-Host '*** LANDesk is now disabled' -ForegroundColor Green
}
Write-Host