Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Reading remote registry keys

$
0
0

 $PCName = (Get-ADComputer -Filter * -SearchBase "OU=baker,OU=MGWorkstations,dc=acme,dc=org").Name 

foreach ($machine in $PCName) {(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run' -Name RebootUtility).RebootUtility}

The above code when run only writes out the registry key information from my local PC.  I have "this is a test" in my reg key and that is all it returns and it returns this 23 times, which is the number of machines in OU=baker.    I did a get-help on get-itemproperty and there does not seem to be a -ComputerName switch.   how do I read a reg key of remote machines and see the output?  

I've googled this but most code I've found pulls the reg reads from the LocalMachine.  


Viewing all articles
Browse latest Browse all 6937

Trending Articles