The following command to create AppPools in IIS executes fine locally; "%windir%\system32\inetsrv\appcmd" add apppool /in < "webservice.apppools.2012.xml"
When I try to run it remotely using PsExec it gives me an 'Invalid XML input' error. From what I can tell the command is coming back to the server I am executing PSEXEC on and getting the xml file from there. This always gives the invalid xml error. Additionally, I tried copying the xml to the remote server but again, the command comes back to the executing server to get the xml file. How can I force it to execute on the remote server and use the xml there? I have tried using -i and -s.
%1 = Destination server
%3 = password
set appCmd=\\%1\c$\Windows\system32\inetsrv\appcmd
set tempFolder=D:\deployment\temp
PsExec \\%1 -u administrator -p %3 -h %appCmd% add apppool /in < "%tempFolder%\webservice.apppools.2012.xml"
There is nothing wrong with the xml as it works fine locally.