Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

restart non XP machines through powershell

$
0
0

Hey guys.

So I'm just trying to script powershell to restart all machines in AD (excluding XP machines)

So this is what I have so far.

dsquery computer "ou=test,ou=it computers,ou=computers ou,dc=DOMAIN,dc=ca" | foreach-object {restart-computer computername $_.name -force}

and when I do that I receive this error

I am being prompted for credentials so I assume thats a good sign.

I also havent added the filter for non XP computers cause everytime I tried it was just failing.

If anyone could spread a little light on both issues it would be much appreciated.


Viewing all articles
Browse latest Browse all 15370

Trending Articles



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