This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

I am new to Solarwinds and trying to setup a powershell component monitor to monitor a bitlockers drives status but i cannot get this to produce an output. my script is below can people kindly point out my glaring errors?

$DriveLetter = "C:";
$Error.Clear();

if ( Test-Path $DriveLetter ) { }
else
 {
 Write-Host "Message: Drive Not found"
 exit 1
 }

$computer=$Env:COMPUTERNAME
$BitLockerStatus = Invoke-Command -ScriptBlock{ Get-BitLockerVolume -MountPoint "$DriveLetter" } -ComputerName $computer  -ErrorAction Stop
$BLMP = $BitLockerStatus.MountPoint
$BLLS = $BitLockerStatus.LockStatus
$BLpe = $BitLockerStatus.EncryptionPercentage

if($BitLockerStatus.LockStatus -eq 'Unlocked')
{
Write-Host "Message:" $BLLS
Write-Host "Statistic:" $BLpe
Exit 0
}
else 
{
Write-Host "Message: $BLLS"
Write-Host "Statistic: $BLpe"
Exit 1
}

Parents Reply Children