Guest User

Untitled

a guest
Jan 16th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. #---------------------------------------------------------
  2. <# Get Co-Sign Registry Key Status
  3. Created 01/14/19 By Mike L>#>
  4. #---------------------------------------------------------
  5.   
  6. Remove-Item -Path C:\Scripts\CoSign\Registry_Fix_Status.csv -ErrorAction Ignore
  7. Import-Csv .\Computers.csv | ForEach-Object {
  8.  
  9. $Computer = $_."Computer"
  10. $OnlineStatus = Test-ComputerConnection $Computer | Select -ExpandProperty Online
  11.  
  12. IF ($OnlineStatus -eq 'True') {
  13.  
  14. $Architecture = Invoke-Command -ComputerName $Computer -ScriptBlock {
  15.  
  16. (Get-CimInstance -ClassName win32_operatingsystem).OSArchitecture
  17.  
  18. }
  19.  
  20. IF ($Architecture -eq '64-bit') {
  21.  
  22. $Value = Invoke-Command -ComputerName $Computer -ScriptBlock {
  23.  
  24. (Get-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\ARL\CoSign\CKitCli\" `
  25. -Name "SSLLibraryVersion" -ErrorAction SilentlyContinue)."SSLLibraryVersion"
  26.  
  27. }
  28.  
  29. }
  30.  
  31. IF($Architecture -eq '32-bit') {
  32.  
  33.  
  34. $Value = Invoke-Command -ComputerName $Computer -ScriptBlock {
  35.  
  36. (Get-ItemProperty -Path "HKLM:\SOFTWARE\ARL\CoSign\CKitCli\" `
  37. -Name "SSLLibraryVersion" -ErrorAction SilentlyContinue)."SSLLibraryVersion"
  38.  
  39. }
  40.  
  41. }
  42.  
  43. IF($Value -eq '2') {
  44.  
  45. $RegistryFixed = "Fixed"
  46. Write-Host $Computer has the correct Co-Sign registry keys -ForegroundColor Green
  47.  
  48. } ELSE {
  49.  
  50. $RegistryFixed = "Needs Fix"
  51. Write-Host $Computer DOES NOT have the correct Co-Sign registry keys -ForegroundColor Cyan
  52.  
  53. }
  54.  
  55. New-Object -TypeName PSCustomObject -Property @{
  56. Computer = $Computer
  57. "RegFix Status" = $RegistryFixed
  58. } | Export-Csv -Path Registry_Fix_Status.csv -NoTypeInformation -Append
  59.  
  60. } ELSE {
  61. Write-Host $Computer is not online -ForegroundColor DarkGray }
  62.  
  63. }
Add Comment
Please, Sign In to add comment