PowerShell script exchange
Post Reply
odruard
Enthusiast
Posts: 40
Liked: 5 times
Joined: Jan 25, 2011 2:12 pm
Full Name: Olivier Druard
Contact:

Install PSSnapin on a Core Server

Post by odruard »

Hello,

We have a core server dedicated to all scripts.
We would like to use it to execute our Veeam reporting scripts, then we need the Veeam PSSnapin on this core server.
Is there a way to install the PSSnapin on a core server, then without the console installation ?

I tried to copy all the Veeam.Backup.PowerShell.xxxx files on core server, then I executed the 2 commands here under, however I received an error in French meaning approximately : "System.Reflection.ReflectionTypeLoadException: Unable to load one or several required types". I don't know if some file is missing, if it cannot work this way, or if I forgot some point.

Code: Select all

set-alias installutil $env:windir\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe
installutil "C:\Program Files\Veeam\Backup and Replication\Console\Veeam.Backup.PowerShell.dll"
Thanks for your replies
Olivier Druard
tdewin
Veeam Software
Posts: 1775
Liked: 646 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: Install PSSnapin on a Core Server

Post by tdewin »

Seems pretty generic error. Probably it is unable to find some of the dotnet classes because some dlls are missing. I don't have a core installation, but can you not run the "<drive letter>:\Backup\Shell.x64.msi" wizard? Or does it give errors saying that the OS is not supported (didn't test this). I would give it a shot because you can also install the VMware tools in core by running the setup.exe (which shows the GUI)
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Install PSSnapin on a Core Server

Post by veremin » 1 person likes this post

You cannot install backup server on a machine running Microsoft Windows Server Core. Thus, the similar problems with snap-in installation. Thanks.
odruard
Enthusiast
Posts: 40
Liked: 5 times
Joined: Jan 25, 2011 2:12 pm
Full Name: Olivier Druard
Contact:

Re: Install PSSnapin on a Core Server

Post by odruard »

Hello,

Yes I can install Shell.x64.msi. However we would like to not install the console.
We were looking for a way to install only Veeam PSSnapin.

With Veeam B&R v8, there were a dedicated msi for PSSnapin.
It has disapeared with v9, and I hoped there were some hidden way to isntall it.
But it does not seem.

Olivier Druard
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Install PSSnapin on a Core Server

Post by veremin » 1 person likes this post

PowerShell snap-in became a part of backup server and therefore cannot be installed separately any longer. Thanks.
odruard
Enthusiast
Posts: 40
Liked: 5 times
Joined: Jan 25, 2011 2:12 pm
Full Name: Olivier Druard
Contact:

Re: Install PSSnapin on a Core Server

Post by odruard » 4 people like this post

Hello,

I found a workaround to use Veeam PSSnapin on a Windows Core server : Implicit Remoting
Explanation from Microsoft here : https://technet.microsoft.com/en-us/lib ... 20181.aspx

On the core server (or on any server where you want to use Veeam PSSnapin but avoid to install console), run this 3 powershell commands (XXXXXXXXX is the name of a server where PSSnapin are installed):

Code: Select all

$Session = New-PSSession -ComputerName XXXXXXXXX
Invoke-Command -ScriptBlock {Add-PSSnapin VeeamPSSnapin} -Session $Session
Import-PSSession -PSSnapin VeeamPSSnapin -Session $Session
Then the Veeam Cmdlets are now available for the duration of the Powershell session.
A Get-Command shows that they are furnished by a temporary module (named here tmp_ytod4d3h.u2m):

Code: Select all

PS C:\> Get-Command *vbr*

CommandType     Name                                               ModuleName
-----------     ----                                               ----------
Function        Add-VBRAzureAccount                                tmp_ytod4d3h.u2m
Function        Add-VBRBackupJob                                   tmp_ytod4d3h.u2m
Function        Add-VBRBackupRepository                            tmp_ytod4d3h.u2m
Function        Add-VBRBackupToTapeJob                             tmp_ytod4d3h.u2m
Function        Add-VBRCloudGateway                                tmp_ytod4d3h.u2m
Function        Add-VBRCloudGatewayCertificate                     tmp_ytod4d3h.u2m
Function        Add-VBRCloudProvider                               tmp_ytod4d3h.u2m
Function        Add-VBRCloudPublicIP                               tmp_ytod4d3h.u2m
Function        Add-VBRCloudSubTenant                              tmp_ytod4d3h.u2m
Of course, I didn't try each command, however my first tests show that it seem to be a good solution.
And it is a standard way to use PowerShell, then it can be used on production servers.

Olivier
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Install PSSnapin on a Core Server

Post by veremin » 1 person likes this post

Hmm, I have never thought about proxying powershell snap-in or modules, nor have I tried it in a wild, but the premise looks promising. Thanks for sharing this creative workaround; highly appreciated.
evilaedmin
Expert
Posts: 176
Liked: 30 times
Joined: Jul 26, 2018 8:04 pm
Full Name: Eugene V
Contact:

Re: Install PSSnapin on a Core Server

Post by evilaedmin »

Appears to work well, thank you for sharing Olivier!
odruard wrote: Aug 26, 2017 5:33 am Hello,

I found a workaround to use Veeam PSSnapin on a Windows Core server : Implicit Remoting
Explanation from Microsoft here : https://technet.microsoft.com/en-us/lib ... 20181.aspx
RaboRemco
Novice
Posts: 8
Liked: 1 time
Joined: Apr 18, 2019 8:15 am
Full Name: Remco Post
Contact:

Re: Install PSSnapin on a Core Server

Post by RaboRemco » 1 person likes this post

Hmmm, this is a pity. Having to install the entire console makes things messy. Can't Veeam create a separate powershell package? Or even better, make every function, and I mean really every function available via the enterprise manager RESTful API. It still amazes me how half-finished that looks. Even functions available in the EM GUI are not publicly available.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 20 guests