Is there a way to suspend Bitlocker for a drive programmatically from .NET?
A:
Edit: Found a better answer.
There's actually a WMI class called Win32_EncryptableVolume that could probably be used to do this in a nice way. It has a Decrypt
method that might be useful.
Old answer below here
In Windows 7, look at the tool manage-bde.exe
, in Vista look at the script manage-bde.wsf
.
Assuming that they can do what you want, you should be able to call them with the relevant parameters from your .Net app.
ho1
2010-08-12 10:49:12
I don't need to decrypt, only suspend. I'll check if the WMI class has such a method.
Andrew J. Brehm
2010-08-12 12:46:46
@Andrew: Yes, I don't know BitLocker that much so wasn't sure exactly what you needed. Though thinking about it, maybe it's `DisableAutoUnlock` that you need?
ho1
2010-08-12 12:58:42
PowerShell doesn't seem to know that Win32_ class.
Andrew J. Brehm
2010-08-12 13:48:10
@Andrew: Never used Powershell, in C# you need to add a reference to System.Management to use any of the WMI classes, could there be something similar you need to do? Otherwise, this blog post seems to have a sample for using it from Powershell: http://olddogsblog.spaces.live.com/blog/cns!C2DB05EEFA6C21A1!223.entry and here's a general WMI from powershell article: http://technet.microsoft.com/en-us/magazine/2007.05.powershell.aspx
ho1
2010-08-12 16:56:08
Thanks. I was planning to use this from C# but I usually try everything out in PS first.
Andrew J. Brehm
2010-08-12 17:28:05