PowerShell script exchange
Post Reply
genz61
Lurker
Posts: 1
Liked: never
Joined: Jan 30, 2024 6:49 am
Full Name: Eugene
Contact:

Get-VBRServer : Remote connection was terminated

Post by genz61 »

Good afternoon. I installed version 10 first, installed version 11 on top. When I try to run the powershell script, I get the following error.

Code: Select all

Asnp : The Windows PowerShell snap-in 'VeeamPSSnapin' is not installed on this computer.
At C:\scripts_Veeam\Veeam_.ps1:69 char:1
+ Asnp VeeamPSSnapin
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (VeeamPSSnapin:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

Get-VBRServer : Remote connection was terminated. Either re-establish remote connection or use local one, ex.
Connect-VBRServer -Server localhost
At C:\scripts_Veeam\Veeam_.ps1:71 char:11
+ $Server = Get-VBRServer -name $HostName
+           ~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], Exception
    + FullyQualifiedErrorId : System.Exception

Find-VBRViEntity : Remote connection was terminated. Either re-establish remote connection or use local one, ex.
Connect-VBRServer -Server localhost
At C:\scripts_Veeam\Veeam_.ps1:76 char:9
+   $VM = Find-VBRViEntity -Name $VMName -Server $Server
+         ~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], Exception
    + FullyQualifiedErrorId : System.Exception

Start-VBRZip : Remote connection was terminated. Either re-establish remote connection or use local one, ex.
Connect-VBRServer -Server localhost
At C:\scripts_Veeam\Veeam_.ps1:86 char:19
+     $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compre ...
+                   ~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], Exception
    + FullyQualifiedErrorId : System.Exception

You cannot call a method on a null-valued expression.
At C:\scripts_Veeam\Veeam_.ps1:91 char:5
+     $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().upd ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
On another virtual machine, with the same installation scheme, everything worked.
Mildur
Product Manager
Posts: 8735
Liked: 2294 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Get-VBRServer : Remote connection was terminated

Post by Mildur »

Hi Eugene

Can you please share your entire script (C:\scripts_Veeam\Veeam_.ps1)? Not just the output?
Asnp : The Windows PowerShell snap-in 'VeeamPSSnapin' is not installed on this computer.
We deprecated PS Snapins. You can remove this part in the script. It's no longer needed.

May I ask, why you have only updated to v11? The most recent version is V12.1.1.56:
https://www.veeam.com/kb4510

Best,
Fabian
Product Management Analyst @ Veeam Software
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get-VBRServer : Remote connection was terminated

Post by oleg.feoktistov »

Hi Eugene,

Have you used Connect-VBRServer cmdlet to establish connection between powershell module and VBR server? The error you encountered usually indicates that the connection wasn't established (cmdlet not used) or was terminated for some reason and you need to use Connect-VBRServer to re-establish it.

Best regards,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests