sunhux
asked on
How to remove & add a Program using PowerShell command
I'll need to uninstall a software agent on a mass scale (thousands) & then install with another version
as doing so one by one is not feasible.
I have a way to send "Remote PowerShell" commands (though I could send Windows batch ie .bat
commands too but often this run into errors) to the various Windows servers. Below is the
output of sc queryex of the service & attached the software name (which is an msi file ie uninstall
Agent-Windows-8.0.0-1732.x 86_64.msi, Agent-Windows-9.0.0-2004.x 86_64.msi
& then reinstall with Agent-Windows-9.0.0-5001.x 86_64.msi )
sc queryex ds_agent
SERVICE_NAME: ds_agent
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
DS_RemovePgm.jpg
as doing so one by one is not feasible.
I have a way to send "Remote PowerShell" commands (though I could send Windows batch ie .bat
commands too but often this run into errors) to the various Windows servers. Below is the
output of sc queryex of the service & attached the software name (which is an msi file ie uninstall
Agent-Windows-8.0.0-1732.x
& then reinstall with Agent-Windows-9.0.0-5001.x
sc queryex ds_agent
SERVICE_NAME: ds_agent
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
DS_RemovePgm.jpg
Sunhux,
I would use psexec with the bat file that you have. You can run the psexec command against a list of machines inputting your username and password one time and it will hit all those machines with the credentials
https://technet.microsoft.com/en-us/sysinternals/psexec.aspx
I would use psexec with the bat file that you have. You can run the psexec command against a list of machines inputting your username and password one time and it will hit all those machines with the credentials
https://technet.microsoft.com/en-us/sysinternals/psexec.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Have used psexec before; challenge is the installation process will prompt to
confirm to proceed & other prompting
confirm to proceed & other prompting
ASKER
to confirm to proceed