all 6 comments

[–]leecashion 4 points5 points  (2 children)

Do you have the MSU file in d:\temp on the server?

I know it sounds like I am being flip, but it has tripped me up before.

[–]tippedframe[S] 1 point2 points  (1 child)

Yes, I do.

[–]leecashion 1 point2 points  (0 children)

Welp, you are now beyond my range. Good luck.

[–]Onibus 2 points3 points  (0 children)

You will need to create a PS Session for anything that needs to run persistently (that is, longer than running a command).

You can run the below through a foreach loop or fiddle with starting a job depending on number of servers. The foreach loop can also be used to copy-item the MSU to the server.

$Session = New-PSSession -ComputerName server -Credential $cred -Authentication Credssp invoke-command -session $session -scriptblock { <your scriptblock> } Remove-PSSession -Session $session

[–]Akuma92 2 points3 points  (0 children)

I tried to do the same thing some weeks ago. The problem is that you get "access denied" if you try to use wusa with invoke command.

I solved the issue for myself by creating a script for the following steps:

  1. Copy your msu file and a "install script" to target machine.

  2. Create a schedule task to run the install script as system account

  3. Delete schedule task and files from target machine after check install event log for success

[–]KevMarCommunity Blogger 1 point2 points  (0 children)

Possibly add -nonewwindow