Veeam snap-in loaded from an incorrect location

PowerShell script exchange

Veeam snap-in loaded from an incorrect location

Veeam Logoby CrestoneGroup » Wed Oct 12, 2016 10:10 pm

Hello all,

I am trying to execute a Powershell backup script for the Free Veeam Backup and Replication product. It is the popular script published on the forum site. It had ran properly in the past. Now when I execute the script I get a the following: Get-VBRServer : Veeam PowerShell snap-in was loaded from an incorrect location. That is the first error, and it crashes on every line after that since that first line sets the Virtual Server object. The snap-in loads without any error. The powershell script is being run from a C:\Scripts folder. But it ran previously, and I haven't changed any powershell functions on that server. I did a google search and couldn't come up with anything specific to that text.

It is a Windows 2008 R2 server running PowerShell 4.0, running Veeam Free Version 9.0 Update 2.

Thanks for your attention.
CrestoneGroup
Novice
 
Posts: 4
Liked: never
Joined: Tue Oct 11, 2016 5:33 pm
Full Name: Dave Pavlicek

Re: Veeam snap-in loaded from an incorrect location

Veeam Logoby v.Eremin » Thu Oct 13, 2016 10:52 am

Out of curiosity - are you trying to run script from a backup server itself or from a different machine backup console is installed on?
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Veeam snap-in loaded from an incorrect location

Veeam Logoby CrestoneGroup » Thu Oct 13, 2016 4:10 pm

We have one server with Veeam installed. I am trying to run the script from that. The VSphere is on a different server.

My guess is that the snap-in registration somehow got corrupted, possibly during a Powershell upgrade or patch from Microsoft. Is there an easy way to unregister and re-register the snap-in ?

I am running the 64 bit powershell with this error. If I run the 32 bit, I get "No snap-ins have been registered for Powershell Version 4". I am assuming the snap-in was written for 64 bit platforms considering its registration and file location.
CrestoneGroup
Novice
 
Posts: 4
Liked: never
Joined: Tue Oct 11, 2016 5:33 pm
Full Name: Dave Pavlicek

Re: Veeam snap-in loaded from an incorrect location

Veeam Logoby v.Eremin » Thu Oct 13, 2016 5:36 pm

Is there an easy way to unregister and re-register the snap-in ?

Try this:

- Remove everything that is present in the following registry hive:

Code: Select all
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\VeeamPSSnapIn


- Re-install snap-in either by clicking Menu -> PowerShell (backup console) or executing Install-VeeamToolkit.ps1 script that is located inside product directory

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

Re: Veeam snap-in loaded from an incorrect location

Veeam Logoby CrestoneGroup » Thu Oct 13, 2016 5:54 pm

Hmm.. Installation of the snapin succeeded with no errors. But same error on the backup script.

Paths in the registry config look correct.

Any other suggestions ?
CrestoneGroup
Novice
 
Posts: 4
Liked: never
Joined: Tue Oct 11, 2016 5:33 pm
Full Name: Dave Pavlicek

Re: Veeam snap-in loaded from an incorrect location

Veeam Logoby v.Eremin » Fri Oct 14, 2016 10:00 am

You can try to remove the said hive once again, then, execute VB&R setup, (re-)install only UI portion (backup console), then, open UI -> Menu -> PowerShell, and see whether this operation helps or not. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Veeam snap-in loaded from an incorrect location

Veeam Logoby CrestoneGroup » Fri Oct 14, 2016 4:51 pm

That did the trick.

I appreciate your help and love your script.

Thank you again
CrestoneGroup
Novice
 
Posts: 4
Liked: never
Joined: Tue Oct 11, 2016 5:33 pm
Full Name: Dave Pavlicek

Re: Veeam snap-in loaded from an incorrect location

Veeam Logoby v.Eremin » Mon Oct 17, 2016 10:54 am

You're welcome. It appears that snap-in registration got corrupted somehow, but by sticking to the right re-registration procedure you were able to resolve that. But it's worth double checking with support team prior to running the utility.

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


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests