-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathValidate_LDISCNvroot.ps1
49 lines (44 loc) · 1.23 KB
/
Validate_LDISCNvroot.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
39
40
41
42
43
44
45
46
47
48
49
EXTERNAL APPLICATION
exe=powershell.exe
args=-executionpolicy bypass %filename%
filename=detect.ps1
<#
.NOTES
===========================================================================
Created on: 10/16/2019 09:54 AM
Created by: Smith-Rick
Filename: Validate_LDISCNvroot.ps1
===========================================================================
.DESCRIPTION
Validates that the ldiscn.vroot file has a value other than 'LDCLIENTDIRECTORY'.
Validation need is a result of identifying systems that had an XML file
with a bogus result even with a clean install.
#>
echo off
$path = 'C:\Program Files (x86)\LANDesk\Shared Files\cbaroot\ldiscn.vroot'
If (Test-Path $path)
{
[xml]$XmlDocument = Get-Content -Path $path
$value = $XmlDocument.application.file.location
if ($value -eq 'LDCLIENTDIRECTORY')
{
echo "detected=true"
echo "reason=Value is not correct."
echo "expected=$path"
echo "found=$value"
}
else
{
echo "detected=false"
echo "reason=Value does not appear corrupt"
echo "expected=$path"
echo "found=$value"
}
}
else
{
echo "detected=true"
echo "reason=File Does Not Exist."
echo "expected=$path"
echo "found=File Not Found"
}