I am automating the configuration of my 2012 servers and I need to figure out how to install the applications using remoting.
I was able to get them to run using PowerShell locally, I think using:
Start-Process -FilePath C:\SystemProvisioning\BGInfo\BGInfoProd-Ver2\InstallProduction.vbs
Start-Process -FilePath C:\SystemProvisioning\Maint2.0_reg_files\MW_PRD_Friday_10pm.reg
Start-Process -FilePath C:\SystemProvisioning\SCCM2012client\install-close-window.bat
Start-Process -FilePath C:\SystemProvisioning\SCOM\agent\SCOM_2012R2_Agent_Install.cmd
Start-Process -FilePath C:\SystemProvisioning\Scripts\RunPCI_Updates1.cmd
Start-Process -FilePath C:\SystemProvisioning\SEP\RunSEPinstall.cmd
But maybe I will need different techniques depending on the type of config or install. As you can see, the previous guy made .cmd and bat files for most of the installs.
The one I am trying to figure out right now is the .reg.
$Svrconf = New-PSSession -ComputerName xxx2c1cr01.corp.com -Credential $cred -Name Svrconf
Invoke-Command -Session $Svrconf -ScriptBlock {C:\SystemPro\Maint2.0_reg_files\MW_PRD_Friday_10pm.reg}
Invoke-Command -Session $Svrconf -ScriptBlock {Set-Location HKLM:\SYSTEM\test | out-null
Get-ItemProperty .\TT_ServerOperations\Maintenance | select ttMaintCollectionName}
The second command is just to see if the setting changed, it did not. There are 20 of these to choose from, so If I don't have to rewrite them all in PowerShell, for now, that would be great.
What about the other one's, will Invoke-command spin up .bat and .cmd?
Testing.
I just read a few older thread and found this:
(Start-Process -FilePath "msiexec.exe" -ArgumentList "<<whatever>>" -Wait -Passthru).ExitCode
This is what I used above, but it doesn't address my need to do this remotely.
I am trying to automate everything...lol