Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

unable to run script for remote computer

$
0
0

I've tried about 100 ways to get my chunk of code to run against $computer. I usually just pass on the name like -property $computername or whatnot but it will not take. Any ideas?

----------

Import-Module ActiveDirectory

cls
$computer = Read-Host 'What is the computername?'

foreach ($printer in $printers)
{
$printer = $printer -replace "HKEY_LOCAL_MACHINE","HKLM:"
Get-ItemProperty  $printer -Name Printer | select Printer

}


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>