So my goal here is to run commands like get-adcomputer | Install-WindowsUpdate -AcceptAll -AutoReboot
I want to get all of my AD computers and pipe the ComputerName to the ComputerName property in Install-WindowsUpdate
. I tried a @foreach statement but it takes forever to run because it does them one at a time. I'm looking for it to do multiple computers at once.
Any ideas?
So what I ended up doing was creating a computers variable from Get-ADcomputer. I piped a select statement to grab the property "Name" and that did the trick. I then plugged the variable into the command:
To make this work, you have to make sure all of the computers have PSWindowsUpdate installed, Enable-WURemoting and set-executionpolicy unrestricted, which i'm not thrilled about.
Hope this helps others out there.