Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Simple script

$
0
0

Hello , 

I'm wondering why when I try to run loop script it doesn't work . For example when I run 

get-wmiobject -computername comp1 win32_startupcommand     - it works 

but when i try something like this :

$comps=get-adcomputer filter * 

foreach ($comp in $comps) {

get-wmiobject -computername $comp wmi32_startupcommand 

}

it doesnt work ... 

any sugesstions ? 


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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