I’ve got an executable which runs with arguments which I need to run on multiple PCs.
This code obviously does not work but it shows the commands.
\$computer\C`$\temp\snetcfg.exe -v -c s -u MS_Server
\$computer\C`$\temp\snetcfg -v -l \$computer\C`$\windows\inf\netserv.inf -c s -i MS_Server
should I copy the *.exe file into C:\temp and if so how would I run it from c:\temp on all the computers??
OR
can I run this *.exe with arguments from a remote file share??
Basically I need to run this in PS 2.0 but most of what I find for this is invoke-command which I believe is not in PS 2.0…
PSRemoting (and Invoke-Command) were added in PowerShell 2.0, so that shouldn’t be a problem. Once you’ve pushed out your exe file, you’d just convert your UNC paths into the equivalent local paths, and do something like this:
As long as you don’t run into the “second hop” problem (which you can read about all over the place by searching for that term), this should probably work.
Am I getting this error because of the double-hop issue??
The firewall exceptions are enabled.
[MLS-LT-207] Connecting to remote server MLS-LT-207 failed with the following error message : WinRM cannot complete the operation. Verify that the
specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and
allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local
subnet. For more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (MLS-LT-207:String) , PSRemotingTransportException
+ FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionStateBroken
Is there any other way to run these commands on the remote computers??