none
Trouble exporting foreach loop into table RRS feed

  • Question

  • Hi, 

    I'm trying to check the values for four registry keys on all AD computers.  I'd like to be able to export to a csv with the computer name, registry key and value.  This is where I'm at:

    Import-Module -Name ActiveDirectory
    
    Get-ADComputer -filter * |
    
    Foreach-Object {
    
     Get-ItemProperty -Path HKLM:\software\policies\Microsoft\Windows\Psched\DiffservByteMappingConforming -Name "ServiceTypeControlledLoad"
     Get-ItemProperty -Path HKLM:\software\policies\Microsoft\Windows\Psched\DiffservByteMappingConforming -Name "ServiceTypeGuaranteed" 
     Get-ItemProperty -Path HKLM:\software\policies\Microsoft\Windows\Psched\DiffservByteMappingNonConforming -Name "ServiceTypeControlledLoad"
     Get-ItemProperty -Path HKLM:\software\policies\Microsoft\Windows\Psched\DiffservByteMappingNonConforming -Name "ServiceTypeGuaranteed" 
     
     } 
     
    

    What I get on the screen looks like this:


    Any ideas on how to get a simple table showing computer name, registry key and value?

    Thanks!

    • Moved by Bill_Stewart Tuesday, November 7, 2017 9:12 PM This is not "fix/debug/rewrite my script for me" forum
    Tuesday, September 5, 2017 5:56 PM

All replies