bitlocker mount vhd


  • I have a vhd file that is encrypted using bitlocker.  I'm trying to find a script that will let me

    mount the file and then to unmount the file.  I found the following script that woks once.

    #Specify the VHD to be mounted
    $VHDName = "F:\Windows.vhd"
    #Get the MSVM_ImageManagementService
    $VHDService = get-wmiobject -class "Msvm_ImageManagementService" -namespace "root\virtualization" -computername "."
    #Mount the VHD
    $Result = $VHDService.Mount($VHDName)

    The problem is that if you miss the request for the password.  It will not ask again if you

    rerun the script. 

    I would like to run a script that would mount the encrypted vhd.  Let me process some data and then close the vhd

    such that it does not appear in windows explorer.

    Currently I right click on the file.  Click mount.  Enter the password.  Run my program on the data in the VHD.

    Then run manage-bde -lock Y:

    Then right click on the y: drive and click eject.

    This process works but it would be nice to script.



    Tuesday, July 09, 2013 9:10 PM


All replies