PowerShell script exchange
Post Reply
Reklov
Expert
Posts: 101
Liked: 4 times
Joined: Aug 28, 2014 12:16 pm
Contact:

PSremoting

Post by Reklov »

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
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: PSremoting

Post by veremin »

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.
Reklov
Expert
Posts: 101
Liked: 4 times
Joined: Aug 28, 2014 12:16 pm
Contact:

Re: PSremoting

Post by Reklov »

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
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: PSremoting

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests