PSremoting

PowerShell script exchange

PSremoting

Veeam Logoby Reklov » Thu Jun 01, 2017 12:11 pm

Hello,

I have a problem with PS remoting and can't find a solution.

I have a need to load the Veeam cmdls on Server1 from a Veeam Server2.
PSRemoting is enabled.
Code: Select all

$Server2 = New-PSSession -computername Server2 -ConfigurationName Microsoft.Powershell

Invoke-Command -Session $Server1 -scriptblock {Add-PSSnapin VeeamPSSnapIn}



If this code will be executed on Server1 it will result in this Error ( sorry, only in German ):

Code: Select all
Das Windows PowerShell-Snap-In VeeamPSSnapIn kann aufgrund des folgenden Fehlers nicht geladen werden: Die Datei oder A
ssembly "file:///C:\Program Files\Veeam\Backup and Replication\Console\Veeam.Backup.PowerShell.dll" oder eine Abhängigk
eit davon wurde nicht gefunden. Die Assembly wird von einer Laufzeit erstellt, die aktueller als die derzeit geladene L
aufzeit ist, und kann nicht geladen werden.
    + CategoryInfo          : InvalidData: (VeeamPSSnapIn:String) [Add-PSSnapin], PSSnapInException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand


Both Servers are 2008R2SP1, Powershell 2.0

On both Servers .Net3.5 and 4.5.2 are available.

Any help will be welcome.

Cheers
Volker
Reklov
Enthusiast
 
Posts: 38
Liked: 1 time
Joined: Thu Aug 28, 2014 12:16 pm

Re: PSremoting

Veeam Logoby v.Eremin » Thu Jun 01, 2017 12:44 pm

It might be worth reaching MS community with questions concerned with general PowerShell issues. Causes for this particular one might vary, starting from usage of wrong instance of PowerShell (there are two instances of PS in x64 system), ending with utilization of obsolete PowerShell version (2.0 is notoriously known for variety of weird problems).

Also, you can install a backup console on server 1 and use our native connecting cmdlets.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: PSremoting

Veeam Logoby Reklov » Thu Jun 01, 2017 1:20 pm

Hi,

thanks for your comment.
I'll use the Veeam cmdls within a Script, so the Console Option does't work for me.
I'll try to contact a MS Community.

Thanks again
Reklov
Enthusiast
 
Posts: 38
Liked: 1 time
Joined: Thu Aug 28, 2014 12:16 pm

Re: PSremoting

Veeam Logoby v.Eremin » Thu Jun 01, 2017 3:39 pm

It was merely a workaround to avoid additional hassle with PS remoting, so nothing prevents you from asking assistance on MS community.

If I were you, I'd start with updating PS first (to 4.0 at least). As I've said already, PowerShell 2.0 has a lot of strange issues.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: EIvanov and 6 guests