Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #---------------------------------------------------------
- <# Get Co-Sign Registry Key Status
- Created 01/14/19 By Mike L>#>
- #---------------------------------------------------------
- Remove-Item -Path C:\Scripts\CoSign\Registry_Fix_Status.csv -ErrorAction Ignore
- Import-Csv .\Computers.csv | ForEach-Object {
- $Computer = $_."Computer"
- $OnlineStatus = Test-ComputerConnection $Computer | Select -ExpandProperty Online
- IF ($OnlineStatus -eq 'True') {
- $Architecture = Invoke-Command -ComputerName $Computer -ScriptBlock {
- (Get-CimInstance -ClassName win32_operatingsystem).OSArchitecture
- }
- IF ($Architecture -eq '64-bit') {
- $Value = Invoke-Command -ComputerName $Computer -ScriptBlock {
- (Get-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\ARL\CoSign\CKitCli\" `
- -Name "SSLLibraryVersion" -ErrorAction SilentlyContinue)."SSLLibraryVersion"
- }
- }
- IF($Architecture -eq '32-bit') {
- $Value = Invoke-Command -ComputerName $Computer -ScriptBlock {
- (Get-ItemProperty -Path "HKLM:\SOFTWARE\ARL\CoSign\CKitCli\" `
- -Name "SSLLibraryVersion" -ErrorAction SilentlyContinue)."SSLLibraryVersion"
- }
- }
- IF($Value -eq '2') {
- $RegistryFixed = "Fixed"
- Write-Host $Computer has the correct Co-Sign registry keys -ForegroundColor Green
- } ELSE {
- $RegistryFixed = "Needs Fix"
- Write-Host $Computer DOES NOT have the correct Co-Sign registry keys -ForegroundColor Cyan
- }
- New-Object -TypeName PSCustomObject -Property @{
- Computer = $Computer
- "RegFix Status" = $RegistryFixed
- } | Export-Csv -Path Registry_Fix_Status.csv -NoTypeInformation -Append
- } ELSE {
- Write-Host $Computer is not online -ForegroundColor DarkGray }
- }
Add Comment
Please, Sign In to add comment