Get-ItemProperty Help

This topic contains 3 replies, has 2 voices, and was last updated by  Kelly Farrell 2 years, 10 months ago.

  • Author
    Posts
  • #22434

    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

    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

    Kelly Farrell
    Participant

    Thanks that worked : )

  • #22450

    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.