Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
General PowerShell
Managing BitLocker with PowerShell (setting passphrase for access to drive)
Last Post 24 Apr 2010 05:10 AM by
Nemo.nW
. 0 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
Nemo.nW
New Member
Posts:1
24 Apr 2010 05:10 AM
Hi guys,
I'm new to Powershell and trying to use it to manage BitLocker on a Windows 7 machine. I'd like to set a password for access to the data drive (not OS drive). Here's what my current "script" looks like:
Get-WmiObject -Class Win32_EncryptableVolume -namespace "root\CIMV2\Security \MicrosoftVolumeEncryption"
foreach($i in $drives)
{
switch($i.GetProtectionStatus().ProtectionStatus)
{
0 {
$i.ProtectKeyWithNumericalPassword()
$i.ProtectKeyWithPassphrase("MyPasswordHere")
}
1 {
Write-Host "Drive is already encrypted!" }
}
}
However, whenever I try to set a password this way I get an error:
+ $i.ProtectKeyWithPassphrase <<<< ("MyPasswordHere")
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WMIMethodException
What's wrong?
Thanks in advance
Nemo.nW
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
General PowerShell
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2