Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Bitlocker status

$
0
0

hello all,

I am trying to write script that will check bitlocker statues on a system, then report if its Encryted or not. this is what I came up with so far, it compiles fine but the statue it reports is incorrect, any help is welcomed. thank you

 

 

 

 

 

 

$computer

 

 

 

=Read-Host

"Enter computer name:"

$Status

 

 

 

=get-wmiobject-computer$computer-namespaceroot\CIMv2\Security\MicrosoftVolumeEncryption-classWin32_EncryptableVolume-ErrorActionSilentlyContinue|where{$_.protectionstatus -eq'1'} |select

ProtectionStatus

$statres

 

 

 

=

$Status

if

 

 

 

($Statres-eq"1"){Write-Host"Encrypted"

}

else

 

 

 

{Write-Host"UnEncrypted"

}


Viewing all articles
Browse latest Browse all 6937

Trending Articles