All, I am trying to write a script that updates a program on a remote machine, however the upgrade requires one or maybe two reboots. When i run the powershell script, it triggers the upgrade and the machine is rebooted once, post reboot the upgrade doesn't resume unless any user account logs in to the machine; post a user login the upgrade automatically resumes and the upgrade process triggers another reboot post which the upgrade is complete.
Is there a way to achieve this? Below is what i am trying.
Invoke-Command -ComputerName $name -ScriptBlock { Unblock-File 'C:\temp\Install\VDAServerSetup_1912.exe'; Start-Process -FilePath C:\temp\Install\VDAServerSetup_1912.exe -ArgumentList '/components VDA', /disableexperiencemetrics, /enable_hdx_ports, /enable_hdx_udp_ports, /enable_real_time_transport, /enable_remote_assistance, '/includeadditional "Citrix Personalization for App-V - VDA"','/exclude "Personal vDisk","Machine Identity Service"', '/includeadditional "Citrix Personalization for App-V - VDA"', '/logpath "c:\becnet\xenapp"', /masterimage, /quiet, /virtualmachine, /disableexperiencemetrics, /optimize, /virtualmachine -wait}
I removed the copy code as that part works fine. The problem i face is that once the above code is triggered on the remote machine, the machine reboots as a part of the upgrade, but once the machine is back up, the upgrade gets stuck unless someone logs on to the machine. Is there a way this can be achieved unattended?
As pointed by Larry below, i had success with the Autologon enabled, however i would like to use that method as the last resort, Is there any other way this can be achieved?