Skip to content

Commit

Permalink
Added bitlocker-status.exe C# source code to repo. (Netflix-Skunkwork…
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcvey authored Aug 5, 2019
1 parent 1fbe220 commit c4d5dd9
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions bitlocker-status/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.WindowsAPICodePack;
using Microsoft.WindowsAPICodePack.Shell;
using Microsoft.WindowsAPICodePack.Shell.PropertySystem;

namespace bitlocker_status
{
class Program
{
static void Main(string[] args)
{
IShellProperty prop = ShellObject.FromParsingName("C:").Properties.GetProperty("System.Volume.BitLockerProtection");
int? bitLockerProtectionStatus = (prop as ShellProperty<int?>).Value;

if (bitLockerProtectionStatus.HasValue && (bitLockerProtectionStatus == 1 || bitLockerProtectionStatus == 3 || bitLockerProtectionStatus == 5))
Console.WriteLine("ON");
else
Console.WriteLine("OFF");
}
}
}

0 comments on commit c4d5dd9

Please sign in to comment.