Page 1 of 2

VeeamPSSnapIn not found

Posted: Mar 04, 2015 4:29 pm
by Jim Mc
Hi,

I'm getting a similar issue to http://forums.veeam.com/powershell-f26/ ... t5870.html

Veeam B&R 8 update 1. Just installed the BPS_x64.msi from the ISO.

When trying to run some basic tests I get the following:

PS C:\Users\xxx> Get-PSSnapin VeeamPSSnapIn
Get-PSSnapin : No Windows PowerShell snap-ins matching the pattern 'VeeamPSSnapIn' were found. Check the pattern and
then try the command again.
At line:1 char:1
+ Get-PSSnapin VeeamPSSnapIn
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (VeeamPSSnapIn:String) [Get-PSSnapin], PSArgumentException
+ FullyQualifiedErrorId : NoPSSnapInsFound,Microsoft.PowerShell.Commands.GetPSSnapinCommand

The DLL Veeam.Backup.PowerShell.dll doesn't seem to exist in the Veeam installation directory @ c:\program files\Veeam\Backup and Replication so I can't register it manually.

I've tried uninstalling and reinstalling the BPS_x64.msi from the ISO and selecting all features are installed locally but it hasn't made any difference.

Help appreciated.

Re: VeeamPSSnapIn not found

Posted: Mar 04, 2015 4:40 pm
by Jim Mc
Hi,

Finally tracked it down, it seems the directory they suggested it was located in in the previous thread wasn't quite accurate, it's actually in:

C:\Program Files\Veeam\Backup and Replication\Backup\Veeam.Backup.PowerShell.dll

So I try to register it manually and get the following error:

Code: Select all

set-alias installutil $env:windir\Microsoft.NET\Framework\v2.0.50727\installutil.exe
installutil 'C:\Progra~1\Veeam\Backup and Replication\Backup\Veeam.Backup.PowerShell.dll'
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.8007
Copyright (c) Microsoft Corporation.  All rights reserved.

Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files\Veeam\Backup and Replication\B
ackup\Veeam.Backup.PowerShell.dll' or one of its dependencies. This assembly is built by a runtime newer than the curren
tly loaded runtime and cannot be loaded..
This is on Windows Server 2012 R2

Re: VeeamPSSnapIn not found

Posted: Mar 04, 2015 4:49 pm
by v.Eremin
Hi, James,

What happens if you instruct PowerShell to utilize a later version of the CLR? Will that help?

Thanks.

Re: VeeamPSSnapIn not found

Posted: Mar 04, 2015 5:16 pm
by Jim Mc
I had a quick browse of the guide but haven't actually attempted the instructions because:

Code: Select all

PS C:\Users\xxx> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.34209
BuildVersion                   6.3.9600.17400
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2
Which should mean the 4.5 CLR is loaded? Version number ends in greater than 17000?

Re: VeeamPSSnapIn not found

Posted: Mar 04, 2015 5:32 pm
by Jim Mc
I just realised it was the 'installutil' alias pointing to the old CLR, the following got it working:

Code: Select all

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\installutil.exe 'c:\progra~1\veeam\backup~1\backup\Veeam.Backup.PowerShell.dll'
followed by:

Code: Select all

PS C:\Windows\system32> add-pssnapin veeampssnapin
PS C:\Windows\system32> get-pssnapin veeampssnapin


Name        : veeampssnapin
PSVersion   : 4.0
Description : This is a PowerShell snap-in that includes the Veeam's cmdlet.
Thanks.

Re: VeeamPSSnapIn not found

Posted: Mar 04, 2015 5:36 pm
by v.Eremin
As far as I know, uselegacyv2runtimeactivationpolicy should be enabled and both 2.0.50727 and 4.0.30319 versions should be listed as supported runtimes. Those changes should be reflected in PS configuration file. But that's more like a first guess. Thanks.

Re: VeeamPSSnapIn not found

Posted: May 20, 2015 8:24 am
by spgsit5upport
All I get is:

Code: Select all

Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> C:\Windows\Microsoft.NET\Framework64\v4.0.30319\installutil.exe "c:\progra~1\veeam\backup~1\back
up\Veeam.Backup.PowerShell.dll"
Microsoft (R) .NET Framework Installation utility Version 4.0.30319.33440
Copyright (C) Microsoft Corporation.  All rights reserved.


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.dl
l assembly's progress.
The file is located at c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.InstallLog.
Installing assembly 'c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.dll'.
Affected parameters are:
   logtoconsole =
   assemblypath = c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.dll
   logfile = c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.InstallLog
An exception occurred while trying to find the installers in the c:\Program Files\Veeam\Backup and Replication\backup\Ve
eam.Backup.PowerShell.dll assembly.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExc
eptions property for more information.
Aborting installation for c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.dll.

An exception occurred during the Install phase.
System.InvalidOperationException: Unable to get installer types in the c:\Program Files\Veeam\Backup and Replication\bac
kup\Veeam.Backup.PowerShell.dll assembly.
The inner exception System.Reflection.ReflectionTypeLoadException was thrown with the following error message: Unable to
 load one or more of the requested types. Retrieve the LoaderExceptions property for more information..

The Rollback phase of the installation is beginning.
See the contents of the log file for the c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.dl
l assembly's progress.
The file is located at c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.InstallLog.
Rolling back assembly 'c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.dll'.
Affected parameters are:
   logtoconsole =
   assemblypath = c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.dll
   logfile = c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.InstallLog
An exception occurred while trying to find the installers in the c:\Program Files\Veeam\Backup and Replication\backup\Ve
eam.Backup.PowerShell.dll assembly.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExc
eptions property for more information.
Aborting installation for c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.dll.
An exception occurred during the Rollback phase of the System.Configuration.Install.AssemblyInstaller installer.
System.InvalidOperationException: Unable to get installer types in the c:\Program Files\Veeam\Backup and Replication\bac
kup\Veeam.Backup.PowerShell.dll assembly.
The inner exception System.Reflection.ReflectionTypeLoadException was thrown with the following error message: Unable to
 load one or more of the requested types. Retrieve the LoaderExceptions property for more information..
An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback wil
l continue. However, the machine might not fully revert to its initial state after the rollback is complete.

The Rollback phase completed successfully.

The transacted install has completed.
The installation failed, and the rollback has been performed.
PS C:\Windows\system32>

Code: Select all

Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 4.
At C:\Program Files\Veeam\Backup and Replication\Backup\Initialize-VeeamToolkit.ps1:137 char:1
+ Add-PSSnapin VeeamPSSnapIn
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (VeeamPSSnapIn:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

Get-PSSnapIn : No Windows PowerShell snap-ins matching the pattern 'VeeamPSSnapIn' were found. Check the pattern and
then try the command again.
At C:\Program Files\Veeam\Backup and Replication\Backup\Initialize-VeeamToolkit.ps1:140 char:11
+ $snapIn = Get-PSSnapIn "VeeamPSSnapIn"
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (VeeamPSSnapIn:String) [Get-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : NoPSSnapInsFound,Microsoft.PowerShell.Commands.GetPSSnapinCommand

          Welcome to the Veeam Backup and Replication PowerShell Toolkit!

To list available commands, type Get-VBRCommand
To list available plugins, type Get-VBRPlugin
To open online documentation on all available commands, type Get-VBRToolkitDocumentation

       Copyright © Veeam Software AG. All rights reserved.

Re: VeeamPSSnapIn not found

Posted: May 20, 2015 8:36 am
by v.Eremin
It seems that the installation of snap-in went wrong, thus, the absence of it. Let support team review installation logs and find out the root cause of the described behaviour. Thanks.

Re: VeeamPSSnapIn not found

Posted: May 20, 2015 9:41 am
by spgsit5upport
How wrong can the install of msi go?

Code: Select all

Affected parameters are:
   logtoconsole = 
   assemblypath = c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.dll
   logfile = c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.InstallLog
An exception occurred while trying to find the installers in the c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.dll assembly.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Aborting installation for c:\Program Files\Veeam\Backup and Replication\backup\Veeam.Backup.PowerShell.dll.

Re: VeeamPSSnapIn not found

Posted: May 21, 2015 8:49 am
by spgsit5upport
Simple reg file does it:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\VeeamPSSnapIn]
"PowerShellVersion"="2.0"
"Vendor"="Veeam"
"Description"="This is a PowerShell snap-in that includes the Veeam's cmdlet."
"VendorIndirect"="VeeamPSSnapIn, Veeam"
"DescriptionIndirect"="VeeamPSSnapIn,This is a PowerShell snap-in that includes the Veeam's cmdlet."
"Version"="8.0.0.0"
"ApplicationBase"="C:\\Program Files\\Veeam\\Backup and Replication\\Backup"
"AssemblyName"="Veeam.Backup.PowerShell, Version=8.0.0.0, Culture=neutral, PublicKeyToken=bfd684de2276783a"
"ModuleName"="C:\\Program Files\\Veeam\\Backup and Replication\\Backup\\Veeam.Backup.PowerShell.dll"

Re: VeeamPSSnapIn not found

Posted: Sep 03, 2015 3:47 pm
by anahaym
Hi all,
i looked at C:\Program Files\Veeam\Backup and Replication\Backup and there are no Veeam.Backup.PowerShell.dll. version Veeam Free 8.0.0.2030
There are only Veeam.Backup.SanPlugin.Hp3PAR.PowerShell.dll, Veeam.Backup.SanPlugin.HpP4k.PowerShell.dll, Veeam.Backup.SanPlugin.NetApp.PowerShell.dll, Veeam.Backup.PSService.dll
which of dll i have to register?

Re: VeeamPSSnapIn not found

Posted: Sep 04, 2015 4:40 am
by ITManager
Great solution, after spending many hours the regkey file finally fixed my problem.

Thanks,

Paul V.

Re: VeeamPSSnapIn not found

Posted: Sep 12, 2015 12:51 am
by seadave
spgsit5upport wrote:Simple reg file does it:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\VeeamPSSnapIn]
"PowerShellVersion"="2.0"
"Vendor"="Veeam"
"Description"="This is a PowerShell snap-in that includes the Veeam's cmdlet."
"VendorIndirect"="VeeamPSSnapIn, Veeam"
"DescriptionIndirect"="VeeamPSSnapIn,This is a PowerShell snap-in that includes the Veeam's cmdlet."
"Version"="8.0.0.0"
"ApplicationBase"="C:\\Program Files\\Veeam\\Backup and Replication\\Backup"
"AssemblyName"="Veeam.Backup.PowerShell, Version=8.0.0.0, Culture=neutral, PublicKeyToken=bfd684de2276783a"
"ModuleName"="C:\\Program Files\\Veeam\\Backup and Replication\\Backup\\Veeam.Backup.PowerShell.dll"
Amazing how much BS there is about getting this to work and something like this is what it takes. Run the installer from the original media and then create a .REG file with this code and merge it with your registry. Thanks so much for posting this. :D

Re: VeeamPSSnapIn not found

Posted: Oct 06, 2015 3:39 pm
by flesz
Thanks a lot , the registry file fix it.
I spent 2 hours trying to make it to work, tried repair and other solutions in this post, none of them worked, except the reg fix

Re: VeeamPSSnapIn not found

Posted: Nov 29, 2015 1:24 am
by riahc3
The reg files does not do it for me either.