Get-ItemProperty Help

This topic contains 3 replies, has 2 voices, and was last updated by Profile photo of Kelly Farrell Kelly Farrell 1 year, 9 months ago.

  • Author
    Posts
  • #22434
    Profile photo of Kelly Farrell
    Kelly Farrell
    Participant

    trying to get the script to run aginst the server list and return the FlashPlayer version with the server name and then I will export it to csv.

    $strcomputer=(Get-Content c:\users\kefarrell\rsd-citrix-pdsrvlist.txt)
    foreach($strcomputer in $strcomputer)
    {
    Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Macromedia\FlashPlayer" |select CurrentVersion

    }

  • #22445
    Profile photo of Venugopal
    Venugopal
    Participant

    Hello,

    You could try this ..

    
    Function Get-RemoteRegistryValue{
         Param(
              $computername=$env:computername,
              $key ='SOFTWARE\Wow6432Node\Macromedia\FlashPlayer',
              $valuename='CurrentVersion'
         )
    
         $reg=[Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computername)
         $regKey=$reg.OpenSubKey($key)
         $regKey.GetValue($valuename)
         
    }
    
    $servers = get-content C:\servers.txt
    
    foreach($server in $servers)
    {
        
        $version = Get-RemoteRegistryValue -computername $server
        Write-Output "Detected Flash Version $version on server $server."
    } 
    
    

    regards,
    venu

  • #22448
    Profile photo of Kelly Farrell
    Kelly Farrell
    Participant

    Thanks that worked : )

  • #22450
    Profile photo of Kelly Farrell
    Kelly Farrell
    Participant

    now I just need to get it to write to csv file : )

You must be logged in to reply to this topic.