PowerShell script exchange
Post Reply
johnfistikis
Influencer
Posts: 11
Liked: 1 time
Joined: Oct 13, 2015 8:09 am
Full Name: John fistikis
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by johnfistikis »

v.Eremin wrote:Actually, John, I quoted @Badger101 and tried to provide a solution for his problem.

As to your issue, I still believe that it is solely related to absence of required permissions, and might be addressed by granting those via adjusting DCOM config.

Thanks.
Already tried that... I will post as soon as I find the solution
Badger101
Novice
Posts: 3
Liked: 1 time
Joined: Oct 18, 2015 5:58 pm
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by Badger101 » 1 person likes this post

v.Eremin wrote:During product installation make sure to install VB&R PS snap-in. Afterwards, you should add it to current PS session, using Add-PSSnapin:
Thanks for the reply. Yes I was installing veeam on another machine and noticed the selection on adding powershell capabilities. This added the commands that I was looking for. I have my script working now without a hitch. I appreciate the quick response!
veremin
Product Manager
Posts: 20261
Liked: 2249 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by veremin »

Yep, that's how snap-in works. It should be added to a PS session first before you can make use of commandlets present in it. Glad to hear you've nailed it. Thanks.
ARoadman
Novice
Posts: 3
Liked: never
Joined: Oct 27, 2015 4:45 pm
Full Name: Andy Roadman
Contact:

[MERGED] : PowerShell Encryption Error

Post by ARoadman »

Could not find anything that directly addressed this issue when I run the script in PS ISE. I can only assume because there is no value but its suppose to be optional.

Code: Select all

Get-Content : Cannot bind argument to parameter 'Path' because it is an empty string.
At F:\Veeam\VeeamZIP (HV).ps1:80 char:58
+     $EncryptionKey = Add-VBREncryptionKey -Password (cat $EncryptionKey | Conver ...
+                                                          ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-Content], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.GetContentCommand
PTide
Product Manager
Posts: 6405
Liked: 720 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: PowerShell Encryption Error

Post by PTide »

Hi,

Could you please show full script code embedded between

[codе] [/codе]

My first thought is that there is something wrong with this part

Code: Select all

cat $EncryptionKey | Conver...
Please check what's the output for cat $EncryptionKey alone.

Thank you.
marcocrx
Lurker
Posts: 1
Liked: never
Joined: Nov 03, 2015 6:52 am
Full Name: marco lee
Contact:

[MERGED] : PowerShell script for Veeamzip of Veeam Free Edit

Post by marcocrx »

I am marco lee

I have tried power shell script for Veeamzip scheduling task
but found below problem.
Please send me advice

br.
marco lee

Code: Select all

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PS C:\Program Files\Veeam\Backup and Replication\Backup> C:\Program Files\Veeam\Backup and Replication\Backup\VeeamZIP (VI - updated).ps1
Asnp : No snap-ins have been registered for Windows PowerShell version 3.
At C:\Program Files\Veeam\Backup and Replication\Backup\VeeamZIP (VI - updated).ps1:69 char:1
+ Asnp VeeamPSSnapin
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (VeeamPSSnapin:String) [Add-PSSnapin], PSArgumentExceptio 
   n
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
 
Get-VBRServer : The term 'Get-VBRServer' is not recognized as the name of a cmdlet, function, script 
file, or operable program. Check the spelling of the name, or if a path was included, verify that the 
path is correct and try again.
At C:\Program Files\Veeam\Backup and Replication\Backup\VeeamZIP (VI - updated).ps1:71 char:11
+ $Server = Get-VBRServer -name $HostName
+           ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-VBRServer:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
Find-VBRViEntity : The term 'Find-VBRViEntity' is not recognized as the name of a cmdlet, function, 
script file, or operable program. Check the spelling of the name, or if a path was included, verify that 
the path is correct and try again.
At C:\Program Files\Veeam\Backup and Replication\Backup\VeeamZIP (VI - updated).ps1:76 char:9
+   $VM = Find-VBRViEntity -Name $VMName -Server $Server
+         ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Find-VBRViEntity:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
Get-Content : Cannot bind argument to parameter 'Path' because it is an empty string.
At C:\Program Files\Veeam\Backup and Replication\Backup\VeeamZIP (VI - updated).ps1:80 char:58
+     $EncryptionKey = Add-VBREncryptionKey -Password (cat $EncryptionKey | Conver ...
+                                                          ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-Content], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell 
   .Commands.GetContentCommand
 
Start-VBRZip : The term 'Start-VBRZip' is not recognized as the name of a cmdlet, function, script file, 
or operable program. Check the spelling of the name, or if a path was included, verify that the path is 
correct and try again.
At C:\Program Files\Veeam\Backup and Replication\Backup\VeeamZIP (VI - updated).ps1:81 char:19
+     $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $Comp ...
+                   ~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Start-VBRZip:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
You cannot call a method on a null-valued expression.
At C:\Program Files\Veeam\Backup and Replication\Backup\VeeamZIP (VI - updated).ps1:91 char:5
+     $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
New-Object : Exception calling ".ctor" with "2" argument(s): "The parameter 'from' cannot be an empty 
string.
Parameter name: from"
At C:\Program Files\Veeam\Backup and Replication\Backup\VeeamZIP (VI - updated).ps1:108 char:12
+ $Message = New-Object System.Net.Mail.MailMessage $EmailFrom, $EmailTo
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCo 
   mmand
 
Property 'Subject' cannot be found on this object; make sure it exists and is settable.
At C:\Program Files\Veeam\Backup and Replication\Backup\VeeamZIP (VI - updated).ps1:109 char:1
+ $Message.Subject = $EmailSubject
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound
 
Property 'IsBodyHTML' cannot be found on this object; make sure it exists and is settable.
At C:\Program Files\Veeam\Backup and Replication\Backup\VeeamZIP (VI - updated).ps1:110 char:1
+ $Message.IsBodyHTML = $True
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound
 
Property 'Body' cannot be found on this object; make sure it exists and is settable.
At C:\Program Files\Veeam\Backup and Replication\Backup\VeeamZIP (VI - updated).ps1:111 char:1
+ $message.Body = $MesssagyBody | ConvertTo-Html -head $style | Out-String
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound
 
Exception calling "Send" with "1" argument(s): "Value cannot be null.
Parameter name: message"
At C:\Program Files\Veeam\Backup and Replication\Backup\VeeamZIP (VI - updated).ps1:113 char:1
+ $SMTP.Send($Message)
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentNullException
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
PTide
Product Manager
Posts: 6405
Liked: 720 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Power shell script for Veeamzip of Veeam Free Edition

Post by PTide »

Hi,

Have you imported veeam powershell snap in in your script? You can do that by using Add-PSSnapIn VeeamPSSnapin. If that does not work please make sure that you have snapin installed.

Thank you.
veremin
Product Manager
Posts: 20261
Liked: 2249 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by veremin »

Hi, Marco,

Try to re-install update, as well, PS snap-in; should help.

Thanks.
veremin
Product Manager
Posts: 20261
Liked: 2249 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: [MERGED] : PowerShell Encryption Error

Post by veremin »

ARoadman wrote:Could not find anything that directly addressed this issue when I run the script in PS ISE. I can only assume because there is no value but its suppose to be optional.
Are you positive $EnableEncryption variable is equal to $False?
MagnaVis
Influencer
Posts: 10
Liked: 2 times
Joined: Nov 06, 2015 5:05 pm
Full Name: Ricky
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by MagnaVis »

v.Eremin wrote: It should. The most frequent solution that I've seen so far for similar issue is to re-install Update 2b along with PS snap-in. Thanks.
As a point of interest, this is what it took for me. Unfortunately, with Update 3 there's not an option to "add" the feature at the time of an update. I tried installing it using the install file from the disk, and registering the DLL as mentioned in other threads. I did the registry hack to get it working, but then it gave me the licensing error that others get. I ran the "Install-VeeamToolkit" script, and got the same thing. So, to get the PS snap-in to work without giving a licensing error, I had to completely uninstall (including SharePoint; couldn't use my current U3 database with a fresh B&R8 install) and reinstall from B&R 8 install media, this time including PS. THEN, update to U3. After that, everything worked well for me.

An awesome feature would be to have the snap-in install be an option during the update. It's a total pain to have to uninstall everything just to get the PowerShell stuff working on the free version; especially when that's one of the major feature differences introduced in Update 2. The steps to get the snap-in installed and working after the fact seem problematic at best, and non-functional for the free version. Additionally, some tested, known good process to get the PS snap-in installed and running after skipping it in the original install would be super awesome. Finally, I really don't know why it isn't installed by default in U2 and later. As a feature that may or may not be licensed to work in earlier versions, it makes sense to have the option to exclude it entirely, but in later versions I would expect it to be bundled. Could the update check to see if it was installed, and just install it if it weren't? Or offer to?

Just some thoughts. Now that I've got it all working, I seriously couldn't be happier. Tested a full backup and restore this evening, and it just worked without a single hitch. This is the greatest solution for backups and restores that I've ever seen for Hyper-V, free or otherwise. The company I've set this up for is considering licensing the software to be able to do incremental backups. Seriously, incredible work is happening at Veeam, and I'm so grateful to have my VMs protected. If you're ever in central NC (Raleigh area) let me know and I'll by the team a round!
veremin
Product Manager
Posts: 20261
Liked: 2249 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by veremin »

I will double check the situation with Update 3 breaking the PS functionality (license complain), once I'm in the office. Can you tell me whether it's been Update 2 to Update 3 upgrade in your case or something different?

Also, we're planning to install PS snap-in by default, starting from VB&R v9.

Thanks.
MagnaVis
Influencer
Posts: 10
Liked: 2 times
Joined: Nov 06, 2015 5:05 pm
Full Name: Ricky
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by MagnaVis »

You guys are so awesome. The license complain only happened when I installed B&R 8 without the PS stuff selected, then tried to add the PS snap-in after the fact. I used the following three resources (in this order) to do so:

1) http://www.veeam.com/kb1489 - Found the file, and installed it. PS still said snap-in not found still.
2) http://forums.veeam.com/powershell-f26/ ... 26632.html - Now PS found the snapin, but said it wasn't licensed
3) http://forums.veeam.com/powershell-f26/ ... 13471.html - Was much like the above, and didn't get me closer
4) http://forums.veeam.com/powershell-f26/ ... tml#p31324 - this was my final try (running the initialize and install scripts) before reinstalling with the PS module selected at install time

So, the real issue I found is that I can't install PS after the fact in a way that works with the free version, and had to completely wipe and reload, not that it was working then started to complain about licensing after U3. Thanks for following up!
ARoadman
Novice
Posts: 3
Liked: never
Joined: Oct 27, 2015 4:45 pm
Full Name: Andy Roadman
Contact:

[MERGED] : Script Does not luanch VeeamBR application

Post by ARoadman »

I have recently started using Veeam 8 and found the PS script for launching and running automated back ups of VMs.

I finally got all the bugs worked out (hopefully) and the script runs with out kicking me errors, however it doesn't do anything. The script runs but Veeam does not launch and no back ups are being run.

Side note: I have Veeam set up on to different networks that are completely unrelated and one works perfectly, but the second I can not get to work. I have gone line by line and except for the host names, VM names, script location, and storage location I can not find any differences.

Thanks
veremin
Product Manager
Posts: 20261
Liked: 2249 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Script Does not luanch VeeamBR application

Post by veremin »

I'm wondering whether you're talking about this script. Thanks.
ARoadman
Novice
Posts: 3
Liked: never
Joined: Oct 27, 2015 4:45 pm
Full Name: Andy Roadman
Contact:

Re: Script Does not luanch VeeamBR application

Post by ARoadman »

Yes that script is the one I used.
I am not a scripting guru by any means and outside of using the PS ISE to troubleshoot the script and log files I am at a loss of where else to look.
veremin
Product Manager
Posts: 20261
Liked: 2249 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by veremin »

Are you trying to execute it manually or via Task Scheduler? In the latter case, try to run it manually using account with the highest privileges (administrator) and see whether it does its job successfully?

Otherwise, I'd recommend going line by line and checking whether all variables are assigned correctly. In other words, whether they contain objects or not.

Thanks.
simonc_999
Lurker
Posts: 2
Liked: never
Joined: Nov 18, 2015 12:29 pm
Full Name: Simon Cliffe
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by simonc_999 »

Hi, sorry if this has been answered previously, I have read the posts but nothing i have tried appears to help?

I am trying to backup using Veeam 8 on a 2012 host with around 8 Hyper V VM's. I downloaded the HV script and made the changes to the variables but am getting errors and the script isn't running. I have tried running as administrator as well, same outcome. I guess it is something I am doing wrong but don't know PS enough to troubleshoot it;

The script;

Code: Select all

# Author: Vladimir Eremin
# Created Date: 3/24/2015
# http://forums.veeam.com/member31097.html
# 

##################################################################
#                   User Defined Variables
##################################################################

# Names of VMs to backup separated by comma (Mandatory). For instance, $VMNames = “VM1”,”VM2”
$VMNames = "CCS-WEB","CCS-EHRM",

# Name of vCenter or standalone host VMs to backup reside on (Mandatory)
$HostName = "CCS-VS0001"

# Directory that VM backups should go to (Mandatory; for instance, C:\Backup)
$Directory = "C:\Backup"

# Desired compression level (Optional; Possible values: 0 - None, 4 - Dedupe-friendly, 5 - Optimal, 6 - High, 9 - Extreme) 
$CompressionLevel = "5"

# Quiesce VM when taking snapshot (Optional; VMware Tools are required; Possible values: $True/$False)
$EnableQuiescence = $True

# Protect resulting backup with encryption key (Optional; $True/$False)
$EnableEncryption = $True

# Encryption Key (Optional; path to a secure string)
$EncryptionKey = ""

# Retention settings (Optional; By default, VeeamZIP files are not removed and kept in the specified location for an indefinite period of time. 
# Possible values: Never , Tonight, TomorrowNight, In3days, In1Week, In2Weeks, In1Month)
$Retention = "Never"

##################################################################
#                   Notification Settings
##################################################################

# Enable notification (Optional)
$EnableNotification = $True

# Email SMTP server
$SMTPServer = ""

# Email FROM
$EmailFrom = "" 

# Email TO
$EmailTo = ""

# Email subject
$EmailSubject = ""

##################################################################
#                   Email formatting 
##################################################################

$style = "<style>BODY{font-family: Arial; font-size: 10pt;}"
$style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
$style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"
$style = $style + "TD{border: 1px solid black; padding: 5px; }"
$style = $style + "</style>"

##################################################################
#                   End User Defined Variables
##################################################################

#################### DO NOT MODIFY PAST THIS LINE ################
Asnp VeeamPSSnapin

$Server = Get-VBRServer -name $HostName
$MesssagyBody = @()

foreach ($VMName in $VMNames)
{
  $VM = Find-VBRViEntity -Name $VMName -Server $Server
  
  If ($EnableEncryption)
  {
    $EncryptionKey = Add-VBREncryptionKey -Password (cat $EncryptionKey | ConvertTo-SecureString)
    $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention -EncryptionKey $EncryptionKey
  }
  
  Else 
  {
    $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention
  }
  
  If ($EnableNotification) 
  {
    $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
    $FailedSessions =  $TaskSessions | where {$_.status -eq "EWarning" -or $_.Status -eq "EFailed"}
  
  if ($FailedSessions -ne $Null)
  {
    $MesssagyBody = $MesssagyBody + ($ZIPSession | Select-Object @{n="Name";e={($_.name).Substring(0, $_.name.LastIndexOf("("))}} ,@{n="Start Time";e={$_.CreationTime}},@{n="End Time";e={$_.EndTime}},Result,@{n="Details";e={$FailedSessions.Title}})
  }
   
  Else
  {
    $MesssagyBody = $MesssagyBody + ($ZIPSession | Select-Object @{n="Name";e={($_.name).Substring(0, $_.name.LastIndexOf("("))}} ,@{n="Start Time";e={$_.CreationTime}},@{n="End Time";e={$_.EndTime}},Result,@{n="Details";e={($TaskSessions | sort creationtime -Descending | select -first 1).Title}})
  }
  
  }   
}
If ($EnableNotification)
{
$Message = New-Object System.Net.Mail.MailMessage $EmailFrom, $EmailTo
$Message.Subject = $EmailSubject
$Message.IsBodyHTML = $True
$message.Body = $MesssagyBody | ConvertTo-Html -head $style | Out-String
$SMTP = New-Object Net.Mail.SmtpClient($SMTPServer)
$SMTP.Send($Message)
}

The output;

You cannot call a method on a null-valued expression.
At C:\backup\veeamps\daily-backup.ps1:91 char:5
+     $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Find-VBRHvEntity : Cannot validate argument on parameter 'Server'. The argument is
argument, and then try running the command again.
At C:\backup\veeamps\daily-backup.ps1:76 char:48
+   $VM = Find-VBRHvEntity -Name $VMName -Server $Server
+                                                ~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Find-VBRHvEntity], ParameterBinding
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerSh

Start-VBRZip : Cannot validate argument on parameter 'Entity'. The argument is null
argument, and then try running the command again.
At C:\backup\veeamps\daily-backup.ps1:86 char:40
+     $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $Comp
+                                        ~~~
    + CategoryInfo          : InvalidData: (:) [Start-VBRZip], ParameterBindingVali
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerSh

You cannot call a method on a null-valued expression.
At C:\backup\veeamps\daily-backup.ps1:91 char:5
+     $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Find-VBRHvEntity : Cannot validate argument on parameter 'Server'. The argument is
argument, and then try running the command again.
At C:\backup\veeamps\daily-backup.ps1:76 char:48
+   $VM = Find-VBRHvEntity -Name $VMName -Server $Server
+                                                ~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Find-VBRHvEntity], ParameterBinding
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerSh

Start-VBRZip : Cannot validate argument on parameter 'Entity'. The argument is null
argument, and then try running the command again.
At C:\backup\veeamps\daily-backup.ps1:86 char:40
+     $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $Comp
+                                        ~~~
    + CategoryInfo          : InvalidData: (:) [Start-VBRZip], ParameterBindingVali
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerSh

You cannot call a method on a null-valued expression.
At C:\backup\veeamps\daily-backup.ps1:91 char:5
+     $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Exception calling "Send" with "1" argument(s): "The SMTP server requires a secure c
authenticated. The server response was: 5.7.0 Authentication required"
At C:\backup\veeamps\daily-backup.ps1:113 char:1
+ $SMTP.Send($Message)
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : SmtpException
I hope this all makes sense?

Thanks in advance

Simon
veremin
Product Manager
Posts: 20261
Liked: 2249 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by veremin »

Apparently you're using the VMware version of the script. Usage of Find-VBRViEntity (commandlet that is supposed to return VMware entities) suggests that. Kindly, make sure to download the proper script version and try it again. Thanks.
simonc_999
Lurker
Posts: 2
Liked: never
Joined: Nov 18, 2015 12:29 pm
Full Name: Simon Cliffe
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by simonc_999 »

Thanks, sorry, a rookie error!

I have made progress, now getting the following error;

Code: Select all

PS C:\Windows\system32> C:\backup\veeamps\test3.ps1
Start-VBRZip : License is not installed.
At C:\backup\veeamps\test3.ps1:86 char:19
+     $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $Comp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Start-VBRZip], CLicenseNotInstalledException
    + FullyQualifiedErrorId : Veeam.Backup.LicenseLib.CLicenseNotInstalledException,Veeam.Backup.PowerShell.Commands.B
   ackup.StartVBRZip
I am using the free version, does this make a difference?
veremin
Product Manager
Posts: 20261
Liked: 2249 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by veremin »

Is at least Update 2 installed? If so, then, VB&R re-installation, along with, PS snap-in might be required. Thanks.
Pyrithe
Service Provider
Posts: 5
Liked: never
Joined: Nov 24, 2015 8:55 am
Full Name: Pyrithe
Contact:

[MERGED] : Veeam Backup Free with Powershell

Post by Pyrithe »

Hi,

I've seen this article about using PowerShell with Backup Free Edition :
http://www.veeam.com/blog/veeam-backup- ... shell.html

I tried to use that on a test-server, with to VM.
When I launched the script, I've got severals errors, so if someone could explain me why??

Code: Select all

"Asnp : Aucun composant logiciel enfichable n'a été inscrit pour Windows PowerShell version 4.
Au caractère C:\Users\Administrateur\Documents\Scripts\VeeamCrozet.ps1:58 : 1
+ Asnp VeeamPSSnapin
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument : (VeeamPSSnapin:String) [Add-PSSnapin], PSArgument 
   Exception
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
 
Get-VBRServer : Le terme «Get-VBRServer» n'est pas reconnu comme nom d'applet de commande, 
fonction, fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un 
chemin d'accès existe, vérifiez que le chemin d'accès est correct et réessayez.
Au caractère C:\Users\Administrateur\Documents\Scripts\VeeamCrozet.ps1:60 : 11
+ $Server = Get-VBRServer -name $HostName
+           ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-VBRServer:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
Find-VBRHvEntity : Le terme «Find-VBRHvEntity» n'est pas reconnu comme nom d'applet de commande, 
fonction, fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un 
chemin d'accès existe, vérifiez que le chemin d'accès est correct et réessayez.
Au caractère C:\Users\Administrateur\Documents\Scripts\VeeamCrozet.ps1:65 : 9
+   $VM = Find-VBRHvEntity -Name $VMName -Server $Server
+         ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Find-VBRHvEntity:String) [], CommandNotFoundExcept 
   ion
    + FullyQualifiedErrorId : CommandNotFoundException
 
Start-VBRZip : Le terme «Start-VBRZip» n'est pas reconnu comme nom d'applet de commande, 
fonction, fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un 
chemin d'accès existe, vérifiez que le chemin d'accès est correct et réessayez.
Au caractère C:\Users\Administrateur\Documents\Scripts\VeeamCrozet.ps1:75 : 19
+     $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $Comp ...
+                   ~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Start-VBRZip:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
Find-VBRHvEntity : Le terme «Find-VBRHvEntity» n'est pas reconnu comme nom d'applet de commande, 
fonction, fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un 
chemin d'accès existe, vérifiez que le chemin d'accès est correct et réessayez.
Au caractère C:\Users\Administrateur\Documents\Scripts\VeeamCrozet.ps1:65 : 9
+   $VM = Find-VBRHvEntity -Name $VMName -Server $Server
+         ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Find-VBRHvEntity:String) [], CommandNotFoundExcept 
   ion
    + FullyQualifiedErrorId : CommandNotFoundException
 
Start-VBRZip : Le terme «Start-VBRZip» n'est pas reconnu comme nom d'applet de commande, 
fonction, fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un 
chemin d'accès existe, vérifiez que le chemin d'accès est correct et réessayez.
Au caractère C:\Users\Administrateur\Documents\Scripts\VeeamCrozet.ps1:75 : 19
+     $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $Comp ...
+                   ~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Start-VBRZip:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException"
veremin
Product Manager
Posts: 20261
Liked: 2249 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by veremin »

What product version are you using? If it's the latest one, try to re-install it along with the PS snap-in; should help. Thanks.
Pyrithe
Service Provider
Posts: 5
Liked: never
Joined: Nov 24, 2015 8:55 am
Full Name: Pyrithe
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by Pyrithe »

v.Eremin wrote:What product version are you using? If it's the latest one, try to re-install it along with the PS snap-in; should help. Thanks.
I don't know if last updates are installed...
I'll verify that, and try to update or re-install and tell you what.
Thx a lot!!
veremin
Product Manager
Posts: 20261
Liked: 2249 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by veremin »

Got it. Waiting for the results of your findings. Based on the experience of previous posters, re-installation is the most frequent solution for this problem. Thanks.
riahc3
Expert
Posts: 110
Liked: 5 times
Joined: Oct 21, 2015 10:01 am
Full Name: John
Contact:

[MERGED] : Start-VBRZip : License is not installed

Post by riahc3 »

Why does this message pop up?

(Obviously I read what it says but...how do you install a free license)

B&R 8 U3
riahc3
Expert
Posts: 110
Liked: 5 times
Joined: Oct 21, 2015 10:01 am
Full Name: John
Contact:

Re: [MERGED] : Start-VBRZip : License is not installed

Post by riahc3 »

riahc3 wrote:Why does this message pop up?

(Obviously I read what it says but...how do you install a free license)

B&R 8 U3
?

Why was this merged? This is talking about Update 2...and Im on Update 3.
riahc3
Expert
Posts: 110
Liked: 5 times
Joined: Oct 21, 2015 10:01 am
Full Name: John
Contact:

Re: [MERGED] : Start-VBRZip : License is not installed

Post by riahc3 » 1 person likes this post

Problem: Standalone Powershell shell using Start-VBRZip pops up "License is not installed". Veeam Backup & Replication 8 Update 3

Solution: Close all instances of Powershell. Reinstall Veeam Backup & Replication 8 Update 3. Error should not pop up again.
veremin
Product Manager
Posts: 20261
Liked: 2249 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by veremin »

Why was this merged?
The thread was created to discuss the script I've created previously allowing you to schedule backups in VB&R Free edition.

Most of the users reporting the license issues actually got it while working with the said script (you can see the issue has been reported here several times). Thus, we're trying to keep everything related to the given script within one discussion.

If it's not the case for you, I'd be glad to split the discussions.

Thanks.
Pyrithe
Service Provider
Posts: 5
Liked: never
Joined: Nov 24, 2015 8:55 am
Full Name: Pyrithe
Contact:

Re: Discussion on blog post: Update 2 featuring PowerShell

Post by Pyrithe »

Hi,

Finally, I've installed the update (now version 8.0.0.2084)
And problem is the same.
Several powershell commands aren't recognize (like explain on my last message).

Any idea?
veremin
Product Manager
Posts: 20261
Liked: 2249 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Start-VBRZip in Veeam Backup Free Edition

Post by veremin »

Correct me if I'm wrong, but you seem to be experiencing the similar issue. If so, try to follow the steps suggested there and open a support ticket, if nothing helps. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests