I need to install an application’s MSP update file on multiple Win08r2 servers. If I run these commands locally, within the target machine’s PS window, it does exactly what I want it to:
The file being executed is located on the target machine
If I remotely connect to the machine, and execute the two commands, it opens two x64 msiexec.exe process, and one msiexec.exe *32 process, and just sits there.
If I restart the server, it doesn’t show that the update was installed, so I don’t think it’s a timing thing.
I’ve tried creating and remotely executing a PS1 file with the two lines, but that seems to do the same thing.
If anyone has advice on getting my MSP update installed remotely, I’d be all ears.
I think I’ve included all the information I have, but if something is missing, please ask questions, and I’ll fill in any blanks.
Thank you in advance for your time and assistance!
It might be (a) an interaction thing, meaning there’s a process waiting for a desktop session or user interaction, or (b) a permissions issue. Curious: have you tried running this as a scheduled task, rather than via remoting? That would help rule out some possibilities. And - I’m only assuming you’re using remoting; you didn’t mention how you’re connecting.
Thank you for your reply! Unfortunately I’m not sure a scheduled task would work here.
My process for this is:
Read a CSV for server name and Administrator password
Create a credential with the password
Create a new session using the machine name and credential
Create a temporary folder to hold my update MSP file
Call a PS1 file that downloads the update file to the target server
Creates a new System.Net.WebClient object
uses that web client object to download from the source to the location on the target server
Call another PS1 file that applies the patch that was just downloaded -->> This is where I'm having issues.
Set the variable shown above
Execute the file specified in the variable
Close the session to the target server
Move to the next server in the CSV...
If I open a PS window and manually set the variable, then execute it (as shown above in the two lines of code), it works fine. If I create a PS1 file on the target server containing the same two lines, then right click > 'Run With PowerShell' a , it blinks the PowerShell window, and does nothing. If I remotely execute my code in PowerGUI, it returns a block of text that looks like this, then just sits there. RDP'd into the server, the installer never launches. My understanding of the "Return Value" value is that "0" means the command was successful.
PSComputerName    : xx.xx.xx.xx
RunspaceId        : bf6f4a39-2338-4996-b75b-bjf5ef01ecaa
PSShowComputerName : True
__GENUSÂ Â Â Â Â Â Â Â Â Â Â : 2
__CLASSÂ Â Â Â Â Â Â Â Â Â Â : __PARAMETERS
__SUPERCLASSÂ Â Â Â Â Â :
__DYNASTYÂ Â Â Â Â Â Â Â Â : __PARAMETERS
__RELPATHÂ Â Â Â Â Â Â Â Â :
__PROPERTY_COUNTÂ Â : 2
__DERIVATIONÂ Â Â Â Â Â : {}
__SERVERÂ Â Â Â Â Â Â Â Â Â :
__NAMESPACEÂ Â Â Â Â Â Â :
__PATHÂ Â Â Â Â Â Â Â Â Â Â Â :
ProcessId         : 4808
ReturnValue       : 0
I even added a line of code between the variable and the execution that creates a text file on the desktop, just to verify I was getting into my ‘executeFile’ file, and that text file does get created. It seems that it’s just not executing my MSP.
If I create a PS1 file on the target server, containing the same two lines of code, then right click > ‘Run With PowerShell’ it works as expected / desired.
You’ve tried a lot of things and I’m not sure I have a good grasp on them all :). I know little about PowerGUI, so I’m going to pas son that one.
So you’re saying this doesn’t work even if you use Remote Desktop to go into the server and launch the installer? If that’s the case, you may have something that has a dependency on the console session, and you’re not going to be able to duplicate that remotely.