Kaseya Community

Script to check if Bitlocker is enabled not returning expected results

  • Hello there! First post here. I had hoped to find a Kaseya IRC channel, but no such luck... too good to be true.

    Anyway - I am new to Kaseya (recently started my first job in IT) and am trying to get as familiar as possible with some of the abilities afforded through the management tools.

    We are configuring Bitlocker to run on machines, and I am finding myself setting aside time to take care of this, only to find out that some users already have Bitlocker enabled. As such, I figured I would write a script to take the guesswork out of things. The script is as follows:



    The results do not return what is expected. The script runs through to completion. The agent logs for a machine that HAS bitlocker enabled (verified through the command in the script done locally on the machine, and has the words "Protection On" within the console output), returns the bitlocker is not enabled.

    Here is the agent procedure log output: 

    Any help would be appreciated. :)

  • So - from the time of posting til now I got it to work.

    Here is the script in working order:

    First, I changed from cmd prompt to powershell. Additionally, I removed the first IF statement (which I believe was the source of the problem?).

  • In regards to a channel, there is a community-run Kaseya server on Discord: https://discord.gg/jSFn87. Enjoy!

  • Off hand the first thing I would try is change the executeShellCommand to run as "user" rather than System.  Otherwise your impersonate user line just above that does absolutely nothing for you.

  • Thanks for the response Jonathan - I had tried that, but it didn't change the outcome. I had actually posted a reply in here stating that I had solved the problem (it said it was awaiting admin approval, but still is not here...).

  • Also someone in another thread posted a couple of scripts that they used for basically the same purpose... They used the powershell options to check though.

    community.kaseya.com/.../104457.aspx

    I've used those with success.