PowerShell script exchange
Post Reply
brianbunke
Lurker
Posts: 2
Liked: never
Joined: Sep 07, 2017 4:52 pm
Contact:

Convert snap-in to module?

Post by brianbunke »

Hello!

Are there any plans to introduce a Veeam PowerShell module to replace the current snap-in? One of my long-standing pain points has been the inability of using PowerShell to remotely administer Veeam as I do with other products.

I'm happy to see the addition of Connect-VBRServer in v9 as a partial solution, but not if it means I need to install B&R on my client workstation to use the PowerShell snap-in.

Accessing REST APIs would work for my purposes, despite it being a less desirable option (since I would have to essentially replicate work you've already performed in the snap-in). However, I'm on Enterprise licensing, which eliminates it as an option.

Apologies if this is a repeat question, but my Google-fu is weak today.
veremin
Product Manager
Posts: 20360
Liked: 2287 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Convert snap-in to module?

Post by veremin »

There were certain plans for this matter. However, due to complexity and the fact that team assigned to PS task is rather limited on spare resources we had to postpone them.

If you don't want to install backup console, you can try to proxy PS snap-in, using workaround proposed here, and see whether it works for you.

Thanks.
brianbunke
Lurker
Posts: 2
Liked: never
Joined: Sep 07, 2017 4:52 pm
Contact:

Re: Convert snap-in to module?

Post by brianbunke »

I understand, but that's disappointing. Does Veeam have any sort of feature request site, where users can create and vote on submissions? I'd be interested in whether other users care about seeing this prioritized.
veremin
Product Manager
Posts: 20360
Liked: 2287 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Convert snap-in to module?

Post by veremin »

Correct, the place is called community forums and you have just submitted the request. Thanks.
nolant
Novice
Posts: 5
Liked: 2 times
Joined: Mar 24, 2016 9:11 pm
Contact:

Re: Convert snap-in to module?

Post by nolant »

I'm certainly in favor of this.
Perhaps this will get a higher priority since PowerShell Core 6.0 has no support for snap-ins.
MaxKozlov
Influencer
Posts: 19
Liked: 5 times
Joined: Oct 26, 2017 12:52 pm
Full Name: Max Kozlov
Contact:

Re: Convert snap-in to module?

Post by MaxKozlov » 1 person likes this post

I'm still testing, but my quick-and-dirty solution is to take all *.dll + *PowerShell* + Client Update.config from the Veeam folder,
put it in the Modules\Veeam
and add this Veeam.psd1

Code: Select all

@{

# Script module or binary module file associated with this manifest.
#RootModule = ''

# Version number of this module.
ModuleVersion = '1.0.0'


# ID used to uniquely identify this module
GUID = '24f208d3-7b21-44ba-b74c-04d413560987'

# Author of this module
Author = 'Veeam'

# Company or vendor of this module
CompanyName = 'Veeam'

# Copyright statement for this module
Copyright = '(c) 2018 Veeam'

# Description of the functionality provided by this module
Description = 'Provide Veeam snapin as module.'

# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '4.0'

# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the Windows PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of the .NET Framework required by this module
DotNetFrameworkVersion = '4.0'

# Minimum version of the common language runtime (CLR) required by this module
#CLRVersion = '4.0'

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
# RequiredModules = @()

# Assemblies that must be loaded prior to importing this module
###RequiredAssemblies = @('')

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @('SSHSession.Format.ps1xml')

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @('Veeam.Backup.PowerShell.format.ps1xml')

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
NestedModules = @('Veeam.Backup.PowerShell.dll')

# Functions to export from this module
FunctionsToExport = '*'

# Cmdlets to export from this module
CmdletsToExport = '*'

# Variables to export from this module
VariablesToExport = '*'

# Aliases to export from this module
AliasesToExport = '*'

# List of all modules packaged with this module.
# ModuleList = @()

# List of all files packaged with this module
#FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess
# PrivateData = ''

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}
it works (but first time it should be runned with -RunAsAdministrator, seems because it register eventlog provider)

I think this is better than proxy (powershell-f26/install-pssnapin-on-a-co ... 45094.html) because proxying do not support all properties (for example LinkedJobs)
MaxKozlov
Influencer
Posts: 19
Liked: 5 times
Joined: Oct 26, 2017 12:52 pm
Full Name: Max Kozlov
Contact:

Re: Convert snap-in to module?

Post by MaxKozlov » 1 person likes this post

correction:

Code: Select all

# Type files (.ps1xml) to be loaded when importing this module
TypesToProcess = @('Veeam.Backup.PowerShell.types.ps1xml')
MaxKozlov
Influencer
Posts: 19
Liked: 5 times
Joined: Oct 26, 2017 12:52 pm
Full Name: Max Kozlov
Contact:

Re: Convert snap-in to module?

Post by MaxKozlov »

Only one issue found by now:

Start-VBRZip (with latest "free" fix) doesn't work. - Exception HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG) - Com Class CLSID {57004E72-7F0B-4A9E-8DDD-8120921C9E14} not registered
adb98
Enthusiast
Posts: 63
Liked: 13 times
Joined: Jul 21, 2016 5:03 pm
Full Name: Aaron B
Contact:

Re: Convert snap-in to module?

Post by adb98 »

Confused and maybe not reading this right but why are you not loading the snappin on your local computer (don't need a full VBR load) and then using your profile to load it when you launch powershell via your profile?

I have it load the snappin and have a keyword to automatically connect to my Veeam server when I need to use it in my profile.

#Veeam Snapin#

Add-PSSnapin -PassThru VeeamPSSnapIn

and then my keyword

function powershellVeeam
{
write-host "Setting up connection to the main VBR server. Please standby"
connect-vbrserver -server mainvbrserver -Credential $secret
}

set-item -path alias:veeam -value powershellVeeam
Cragdoo
Veeam Vanguard
Posts: 629
Liked: 251 times
Joined: Sep 27, 2011 12:17 pm
Full Name: Craig Dalrymple
Location: Scotland
Contact:

Re: Convert snap-in to module?

Post by Cragdoo »

adb98 wrote:Confused and maybe not reading this right but why are you not loading the snappin on your local computer (don't need a full VBR load) ....

Not the full VBR but you do need to install the VBR console, which I guess seems a bit excessive when all you want to do is run a quick Job status check. Module would be incredibly easier than having to lug a 600MB file around to install.
l.vinokur
Enthusiast
Posts: 26
Liked: 10 times
Joined: Sep 25, 2017 6:37 am
Full Name: Leonid Vinokur
Contact:

Re: Convert snap-in to module?

Post by l.vinokur »

Sounds like a good idea, I'll give the module a try.
@Veeam, any plans of moving to PS module instead of Snapins? It's about time :)
veremin
Product Manager
Posts: 20360
Liked: 2287 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Convert snap-in to module?

Post by veremin »

The plans are there, but we cannot comment about ETA. Certainly it won't be implement in the following release, though. Thanks!
l.vinokur
Enthusiast
Posts: 26
Liked: 10 times
Joined: Sep 25, 2017 6:37 am
Full Name: Leonid Vinokur
Contact:

Re: Convert snap-in to module?

Post by l.vinokur »

For the limited number of commands I've tried, the method described by Max worked great.
Thanks Max!
markhensler
Service Provider
Posts: 44
Liked: 4 times
Joined: Mar 10, 2015 6:16 pm
Full Name: Mark Hensler
Contact:

Re: Convert snap-in to module?

Post by markhensler »

Add another vote for a Module.

I'm currently writing a module. I would like to add Veeam to the RequiredModules in my manifest, but I'm not sure if/how this can be done for a Snap-In.
BobsBackups
Service Provider
Posts: 4
Liked: 2 times
Joined: Apr 17, 2019 5:08 pm
Contact:

Re: Convert snap-in to module?

Post by BobsBackups »

Please make this into a module, or at the very least I would like to be able to connect-VBServer to different versions of VBR without having to first connect with the console to update my local version when the only difference is a small hotfix.
veremin
Product Manager
Posts: 20360
Liked: 2287 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Convert snap-in to module?

Post by veremin »

Unfortunately, I wouldn't expect this soon due to reasons stated here. Thanks!
Leo0601
Enthusiast
Posts: 88
Liked: 8 times
Joined: Oct 13, 2020 1:40 pm
Full Name: Leo
Contact:

How to add Veeam snappin for veeam 12 in windows 2019 sever via powershell

Post by Leo0601 »

Hi Experts,

Could someone please let me know, How to add Veeam snappin for veeam 12 in windows 2019 sever via powershell or any other way.

I am looking forward to hear from you

Regards
Leo
Leo0601
Enthusiast
Posts: 88
Liked: 8 times
Joined: Oct 13, 2020 1:40 pm
Full Name: Leo
Contact:

Re: Convert snap-in to module?

Post by Leo0601 »

Could someone please let me know? I am waiting for the Veeam expert's response.

How to add Veeam snappin for veeam 12 in windows 2019 sever via powershell or any other way.

Thanks In advance
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 669 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Convert snap-in to module?

Post by oleg.feoktistov » 1 person likes this post

Hi,

Veeam Powershell Snap-in is not supported in VBR since v11. What you are looking for is a Powershell module. It is usually gets imported automatically in Powershell session, but if it is not, use import cmdlet:

Code: Select all

Import-Module -Name Veeam.Backup.Powershell
Best regards,
Oleg
Leo0601
Enthusiast
Posts: 88
Liked: 8 times
Joined: Oct 13, 2020 1:40 pm
Full Name: Leo
Contact:

Re: Convert snap-in to module?

Post by Leo0601 »

@oleg.feoktistov

Thanks much, Oleg. Yes you are right.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests