PowerShell script exchange
Post Reply
Bobthebuilder
Novice
Posts: 6
Liked: 1 time
Joined: Mar 16, 2018 2:25 pm
Full Name: Bob der Builder

Snapin on Windows Server 2016

Post by Bobthebuilder »

How to get the Veeam snapin registered on Windows Server 2016?

I am aware of the sticky topic in this forums, I am aware of all those .reg-files flying around, PS-Version issues you can have (I read version 3.0 is recommended and not Powershell Version 2.0, however Server 2016 comes with Version 5.1!) etc. I'm out of ideas.
PS C:\Users\administrator.my-domain> cd "C:\Program Files\Veeam\Backup and Replication\Console"
PS C:\Program Files\Veeam\Backup and Replication\Console> .\Install-VeeamToolkit.ps1
Add-PSSnapin : Cannot load Windows PowerShell snap-in VeeamPSSnapIn because of the following error: The Windows PowerShell snap-in module C:\Program Files\Veeam\Backup
and Replication\Backup\Veeam.Backup.PowerShell.dll does not have the required Windows PowerShell snap-in strong name Veeam.Backup.PowerShell, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=bfd684de2276783a.
At C:\Program Files\Veeam\Backup and Replication\Console\Initialize-VeeamToolkit.ps1:197 char:1
+ Add-PSSnapin VeeamPSSnapIn
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (VeeamPSSnapIn:String) [Add-PSSnapin], PSSnapInException
+ 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\Console\Initialize-VeeamToolkit.ps1:199 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 open online documentation on all available commands, type Get-VBRToolkitDocumentation

Copyright © Veeam Software AG. All rights reserved.
PS C:\Users\administrator.my-domain>
This is a fresh Windows Server 2016 Datacenter (with all updates), with a fresh install of B & R free.
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Snapin on Windows Server 2016

Post by veremin »

I'd recommend reaching our support team for further investigation. By the way, does it work, if executed manually from Backup Console (Menu - > Console -> PowerShell?) Thanks.
Bobthebuilder
Novice
Posts: 6
Liked: 1 time
Joined: Mar 16, 2018 2:25 pm
Full Name: Bob der Builder

Re: Snapin on Windows Server 2016

Post by Bobthebuilder »

https://imgur.com/a/Hzllj

Tried another fresh server, same thing. Not interested in a software I have to hassle with support for basic stuff like this, but thanks for your answer.
Bobthebuilder
Novice
Posts: 6
Liked: 1 time
Joined: Mar 16, 2018 2:25 pm
Full Name: Bob der Builder

Re: Snapin on Windows Server 2016

Post by Bobthebuilder » 1 person likes this post

Not sure why you don't allow me to modify my last posting, so here's the solution, following https://support.citrix.com/article/CTX226178:

Old:
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"

New:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\VeeamPSSnapIn]
"PowerShellVersion"="5.1"
"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"="9.5.0.0"
"ApplicationBase"="C:\\Program Files\\Veeam\\Backup and Replication\\Console"
"AssemblyName"="Veeam.Backup.PowerShell, Version=9.5.0.0, Culture=neutral, PublicKeyToken=bfd684de2276783a"
"ModuleName"="C:\\Program Files\\Veeam\\Backup and Replication\\Console\\Veeam.Backup.PowerShell.dll"
Delete your old regedit hive, then save the "New:" thing in a .reg-file and run it. Just replacing "8.0.0.0" with "9.5.0.0" might be sufficient, too. Done.
eeldivad
Influencer
Posts: 11
Liked: never
Joined: Apr 23, 2019 3:43 pm
Full Name: David Lee
Contact:

Re: Snapin on Windows Server 2016

Post by eeldivad »

I notice we don't need to register the snapin for newer versions of Powershell. I'm using Powershell 5. This might work for older versions too. I simply copy all files/subfolders of c:\Program Files\Veeam\Backup and Replication\Console
to another server anywhere you like. Then use import-module directly with Veeam.Backup.PowerShell.dll

import-module D:\scripts\Powershell\modules\Veeam\Veeam.Backup.PowerShell.dll

Now if you run get-module, you will see Veeam.Backup.Powershell listed

To get the list of commands available just run
get-command -module Veeam.Backup.Powershell

I haven't tested all the functions but they seem to work fine for me
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests