I am trying to write a Powershell script that will check all computers for Bitlocker and if it is enabled.<\/p>","upvoteCount":11,"answerCount":14,"datePublished":"2015-07-23T11:37:58.000Z","author":{"@type":"Person","name":"kirillkonovalov9440","url":"https://community.spiceworks.com/u/kirillkonovalov9440"},"acceptedAnswer":{"@type":"Answer","text":"
You’re in luck, I happen to have a report written for this:<\/p>\n
<#\n.SYNOPSIS\n List all workstations in the domain. Fields include LastLogonDate and the latest BitLocker password set date (if present)\n.DESCRIPTION\n List all workstations in the domain. Fields include LastLogonDate and the latest BitLocker password set date (if present)\n.PARAMETER SearchBase\n OU where the script will begin it's search\n.INPUTS\n None\n.OUTPUTS\n CSV in script path\n.EXAMPLE\n .\\New-BitLockerReport.ps1\n.NOTES\n Author: Martin Pugh\n Date: 4/9/2015\n \n Changelog:\n 4/9 MLP - Initial Release\n 4/15 MLP - Added code to load ActiveDirectory tools, or error out if they aren't present\n#>\n\n[CmdletBinding()]\nParam (\n [string]$SearchBase = \"OU=YourOUforWorkstations,DC=Your,DC=Domain\"\n)\n\nTry { Import-Module ActiveDirectory -ErrorAction Stop }\nCatch { Write-Warning \"Unable to load Active Directory module because $($Error[0])\"; Exit }\n\nWrite-Verbose \"Getting Workstations...\" -Verbose\n$Computers = Get-ADComputer -Filter * -SearchBase $SearchBase -Properties LastLogonDate\n$Count = 1\n$Results = ForEach ($Computer in $Computers)\n{\n Write-Progress -Id 0 -Activity \"Searching Computers for BitLocker\" -Status \"$Count of $($Computers.Count)\" -PercentComplete (($Count / $Computers.Count) * 100)\n New-Object PSObject -Property @{\n ComputerName = $Computer.Name\n LastLogonDate = $Computer.LastLogonDate \n BitLockerPasswordSet = Get-ADObject -Filter \"objectClass -eq 'msFVE-RecoveryInformation'\" -SearchBase $Computer.distinguishedName -Properties msFVE-RecoveryPassword,whenCreated | Sort whenCreated -Descending | Select -First 1 | Select -ExpandProperty whenCreated\n }\n $Count ++\n}\nWrite-Progress -Id 0 -Activity \" \" -Status \" \" -Completed\n\n$ReportPath = Join-Path (Split-Path $MyInvocation.MyCommand.Path) -ChildPath \"WorkstationsWithBitLocker.csv\"\nWrite-Verbose \"Building the report...\" -Verbose\n$Results | Select ComputerName,LastLogonDate,BitLockerPasswordSet | Sort ComputerName | Export-Csv $ReportPath -NoTypeInformation\nWrite-Verbose \"Report saved at: $ReportPath\" -Verbose\n\n<\/code><\/pre>","upvoteCount":17,"datePublished":"2015-07-23T12:40:32.000Z","url":"https://community.spiceworks.com/t/bitlocker-status-on-all-computers/421788/5","author":{"@type":"Person","name":"martin9700","url":"https://community.spiceworks.com/u/martin9700"}},"suggestedAnswer":[{"@type":"Answer","text":"
Advertisement
I am trying to write a Powershell script that will check all computers for Bitlocker and if it is enabled.<\/p>","upvoteCount":11,"datePublished":"2015-07-23T11:37:58.000Z","url":"https://community.spiceworks.com/t/bitlocker-status-on-all-computers/421788/1","author":{"@type":"Person","name":"kirillkonovalov9440","url":"https://community.spiceworks.com/u/kirillkonovalov9440"}},{"@type":"Answer","text":"
Good luck!<\/p>\n
Seriously, though, you need to give us a bit more. This forum isn’t for soliciting scripts, it’s about helping you along as you work on learning to use Powershell or if you get stuck somewhere.<\/p>\n
Try starting by researching manage-bde<\/a> and the Bitlocker module<\/a> .<\/p>","upvoteCount":4,"datePublished":"2015-07-23T11:48:38.000Z","url":"https://community.spiceworks.com/t/bitlocker-status-on-all-computers/421788/2","author":{"@type":"Person","name":"mattmcnabb","url":"https://community.spiceworks.com/u/mattmcnabb"}},{"@type":"Answer","text":"\n- \n
do you have a list of computers, say in computers.txt? Or do you want to use the computer accounts in the AD.<\/p>\n<\/li>\n
- \n
Is remoting turned on on all your systems.<\/p>\n<\/li>\n<\/ol>\n
if you have either, then for each system (either in the AD or computers.txt), use Get-BitlockerVolume, which looks a bit like this:<\/p>\n
PSH [C:\\foo]: get-bitlockervolume\n\n ComputerName: WIN10\n\nVolumeType Mount CapacityGB VolumeStatus Encryption KeyProtector AutoUnlock Protection\n Point Percentage Enabled Status\n---------- ----- ---------- ------------ ---------- ------------ ---------- ----------\nOperatingSystem C: 125.00 FullyDecrypted 0 {} Off\nData E: 146.04 FullyDecrypted 0 {} Off\nData F: 807.04 FullyDecrypted 0 {} Off\n\n<\/code><\/pre>\n<\/sub><\/sup>You would then iterate over each computer, an on each computer you’d get all the volumes on that system and iterating over those, you can report volumes NOT protected.<\/p>\nI realise this is not the complete answer, but have a go at writing a script and if you have more problems, post what you have and we’ll take a look.<\/p>","upvoteCount":2,"datePublished":"2015-07-23T12:36:09.000Z","url":"https://community.spiceworks.com/t/bitlocker-status-on-all-computers/421788/3","author":{"@type":"Person","name":"DoctorDNS","url":"https://community.spiceworks.com/u/DoctorDNS"}},{"@type":"Answer","text":"
Yes I have a list of computer in a csv file I can use.<\/p>","upvoteCount":0,"datePublished":"2015-07-23T12:37:15.000Z","url":"https://community.spiceworks.com/t/bitlocker-status-on-all-computers/421788/4","author":{"@type":"Person","name":"kirillkonovalov9440","url":"https://community.spiceworks.com/u/kirillkonovalov9440"}},{"@type":"Answer","text":"
All the work is actually here:<\/p>\n
BitLockerPasswordSet = Get-ADObject -Filter \"objectClass -eq 'msFVE-RecoveryInformation'\" -SearchBase $Computer.distinguishedName -Properties msFVE-RecoveryPassword,whenCreated | Sort whenCreated -Descending | Select -First 1 | Select -ExpandProperty whenCreated\n<\/code><\/pre>\nSince AD has the BitLocker information in it I just retrieve that out, sort by whenCreated and pick the newest one (passwords change). This won’t actually report the password since it’s encrypted but it can detect if it’s there which means BitLocker is working.<\/p>\n
This is all assuming you’re using AD as a central password store. Not too familiar with BitLocker but I believe you can also roll out individually without AD.<\/p>","upvoteCount":4,"datePublished":"2015-07-23T12:42:48.000Z","url":"https://community.spiceworks.com/t/bitlocker-status-on-all-computers/421788/6","author":{"@type":"Person","name":"martin9700","url":"https://community.spiceworks.com/u/martin9700"}},{"@type":"Answer","text":"