Advertisement
Guest User

Untitled

a guest
Nov 8th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Import-Module Invoke-Parallel
  2.  
  3. $folderlocation = "C:\Users\matthew.brown\Documents\Knowledge\Scripts\Bitlocker Inventory"
  4.  
  5.  
  6. $hostname = $null
  7.  
  8. $hostnames = Get-Content "$folderlocation\TEST.txt"
  9.  
  10. $Script   = {
  11.     $Session = New-PSSession -ComputerName $_
  12.     $BDEresult = Invoke-Command -Session $Session -ScriptBlock {manage-bde -status -computername $hostname}
  13.     Remove-PSSession $Session
  14.     return $BDEresult
  15.     }
  16.    
  17.  
  18. $params =  @{
  19.         ComputerName    = $hostnames;
  20.         ScriptBlock     = $Script;
  21.         ImportVariables = $True;
  22.         RunspaceTimeout = 900;
  23.         Throttle        = 100;            
  24.         Verbose         = $True
  25.         }
  26.  
  27. $Report = @(Invoke-Parallel @params)
  28.  
  29. $Result = $Report | Where-Object {$_ -like "*aes*"}
  30.  
  31. $Result | Export-Csv "$folderlocation\TESTRESULTS.txt"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement