Advertisement
Pastabasta

Bitlocker AD Export

Jul 20th, 2024
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Export Bitlocker ActiveDirectory
  2. $Result = Get-ADObject -Filter {objectclass -eq 'msFVE-RecoveryInformation'} -Properties msFVE-RecoveryPassword |
  3.   Select-Object @{n="Computername";e={$_.DistinguishedName.Split(",")[1].Replace("CN=","")} }, `
  4.   @{Name="Datum";Expression={[datetime]::Parse($($_.Name.Split("+,")[0]))}}, `
  5.   @{n="Kennwort-ID";e={$_.DistinguishedName.Split("{")[1].Split("}")[0]} } , `
  6.   msFVE-RecoveryPassword | Sort-Object Computername, Datum -Descending
  7.  
  8. #Searchmask
  9. $Result | Out-GridView -PassThru
  10.  
  11. #Export
  12. $Result | Export-CSV -Path C:\Bitlocker.csv -Delimiter ";" -Encoding UTF8 -NoTypeInformation
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement