The code I provided should run okay.

It will run against the remote computer (change the name to at least 2 computers you want to test it on, so it stays as an array)

The name value for stopping and starting the SERVICE should work if that batch file is correct on the name.

You may be able to do without the
wuauclt /resetauthorization /detectnow
portion of the code.

Simply change the $sComputers to the name of 2 computers you want to test and then run the code and check on those computers.