Tuesday, October 13, 2015

PowerShell and BitLocker : Create a Password Protected encrypted drive.

 

In the previous blog post , we discussed a little bit about BitLocker. And we  also see that how can user Get-BitLockerVolume to show us all the drives, including encrypted and non-encrypted one.

Today, we are going to see, how can we encrypt password protected drive using BitLocker Powershell module cmdlets.

When  I run the Get-BitLockerVolume cmdlet, it shows me the below output, you can see , that I have two drives are both are not encrypted.

I am interested in encrypting my Data Drive which is drive letter D:\.

Let's encrypt it.

1

To encrypt a drive, we use the Enable-BitLockerVolume cmdlet

Remember: We need to create a Secure String Password, if you want to open the BitLocker encrypted drive using Password.

$pass = ConvertTo-SecureString "Passw0rd" -AsPlainText -Force

In above command, we are creating a new secure string of text, Passw0rd, this will be out password to unlock the BitLocker encrypted drive.

Enable-BitLocker -MountPoint D:\ -EncryptionMethod Aes128 -Password $pass -PasswordProtector

 

In abov command, we are using Enable-BitLocker to encrypting our drive, in -MountPoint, we are providing the drive letter of the disk which we want to encrypt, in -EncryptionMethod we are providing, which type of encryption we are going to use, it can be either Aes128 or Aes256 , in -Password we have provided the variable $pass in which our secure string is strored, and then -PasswordProtector parameter.

 

Now it the enter, you can see that the BitLocker has started the encrypting the drive...

2

3

In the next blog post, we will see that how can we mount encrypted drives using PowerShell.

Take care till then.

Aman Dhally

With Regards.
Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.

Monday, October 12, 2015

PowerShell and BitLocker : The World of Encrypting and Decrypting Drives.

 

data-encryption

Encryption and Decryption. When these two words comes in my mind, visual images of some one seeing lots of 0 and 1 comes in my minds, like if you are seeing the Matrix movie.In geeky movies, or T.V series like Mr. Robot , the guys mainly seems to be using Linux :) command line utilities for encrypting hard drives or USB flash drives.

If you use external hard disk or USB drives to carry confidential data, then your disk must be encrypted,  in-case of loss of them , no one else should get the data from these drives.

In Windows we use the BitLocker to encrypted and decrypt drives. BitLocker uses the Trusted Platform Module (TPM)  microchip to store the cryptographic information.

To know more about BitLocker visit this link : http://windows.microsoft.com/en-in/windows-vista/bitlocker-drive-encryption-overview

In Windows 10, there is already module for BitLocker ( Awesome !!!!!, I am assuming this module is available in windows 8.1 too. ) .  That' means, we can encrypt and decrypt drives by using PowerShell too. Bravo!!!!

1

Let's check, what are the cmdlets are available in BitLocker PowerShell module.

Get-Command * -Module BitLocker 

 

OK!. Not much cmdlets, there see,to have some cmdlet only. Let' find out which cmdlet is let us see the list of all drives, including the encrypted ones.

 

2

 

Get-BitLockerVolume , is the cmdlet, which shows us the list of all drives, including the encrypting and non-encrypting ones.

 

Run  the cmdlet and you will get the error... because,  YOU HAVE TO RUN THESE CMDLETS , AS AS ADMINISTRATOR

3

Now ,Get-BitLockerVolume as as admin and you will see the below output. You can see, that it is showing us all drives, including, encrypting ones and and even showing the the Encryption Percentage status, 100% means, the disk is fully encrypted.

Cool!!! Now in next blog posts, we are going to encrypt one of our external drive :) 

Aman Dhally

Aman Dhally

Thanks for your time.

giphy

With Regards.
Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.

Sunday, October 11, 2015

What's New : PowerShell Console now shows formatting errors too in Version 5.0

 

Finally I have upgraded my main laptop to Windows 10. More I  use it , more I start loving it.

Do you know what I like most in Windows 10. It's PowerShell Version 5.0.

Not sure if you have notice  yet, PowerShell console become more beautiful and colorful.  The best thing is , that it has supported the error coloring too.

In the below screenshot you can see that the in the below command, the one "single quote " is missing, and you can see that the greater than symbol > turns red.

Brilliant! 

1

and when you complete the command the > turn back to white again.

2

Cool! :) .

 
tumblr_ndk3ds6b7C1r45g3go1_500
 
With Regards.
Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.