I'm not sure how this forum works....I have a post on this subject matter already but I've already marked it as "answered" so I'm not sure if those get checked. But.... I'm having issues with this code snippet.
$Reg= [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $machine)
$RegKey=$Reg.OpenSubKey("SOFTWARE\\SSOProvider\\ISXAgent")
$Type=$RegKey.GetValue("Type")
cls
$machine
$Type
switch ($Type)
{
1 {$c.Cells.Item($row, 12) ="Type 1 Standalone"; break}
2 {$c.Cells.Item($row, 12) ="Type 2 Kiosk"; break}
default {Write-Host"No Imprivata"; break}
}
$machine is populated from reading an active directory OU. I then run a test-connection to see if the machine is online. If it is online then I do some stuff. One thing I do is check to see if a software called Imprivata is installed. (it is single sign on software). It has two types of install, Standalone or Kiosk, which is written to the registry. what keeps happening is machines that do not have the ISXAgent registry key report as Type 2 Kiosk. I thought it was reading my desktop over and over so that is why I put in the print statements. I even deleted my local reg key to make sure it was not reading my machine. Why would this happen?