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

Install PSSnapin on a Core Server

Post by odruard » Aug 18, 2017 2:46 pm

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: 1363
Liked: 451 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: Install PSSnapin on a Core Server

Post by tdewin » Aug 21, 2017 11:24 am

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)

v.Eremin
Product Manager
Posts: 15807
Liked: 1252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Install PSSnapin on a Core Server

Post by v.Eremin » Aug 21, 2017 4:34 pm 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: 39
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 » Aug 21, 2017 9:06 pm

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

v.Eremin
Product Manager
Posts: 15807
Liked: 1252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Install PSSnapin on a Core Server

Post by v.Eremin » Aug 22, 2017 10:28 am 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: 39
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 » Aug 26, 2017 5:33 am 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

v.Eremin
Product Manager
Posts: 15807
Liked: 1252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Install PSSnapin on a Core Server

Post by v.Eremin » Aug 30, 2017 1:44 pm 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
Enthusiast
Posts: 84
Liked: 12 times
Joined: Jul 26, 2018 8:04 pm
Full Name: Eugene V
Contact:

Re: Install PSSnapin on a Core Server

Post by evilaedmin » Jan 21, 2019 10:06 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests