What do you mean by "does not work"? Please elaborate on that. Have you searched for a solution in this thread?Azerty wrote:In fact, the script you gave me does not work.
Thanks
What do you mean by "does not work"? Please elaborate on that. Have you searched for a solution in this thread?Azerty wrote:In fact, the script you gave me does not work.
A big thank you for your work Vladimir.v.Eremin wrote:You're welcome. Feel free to ask for additional clarification, should one be needed. Thanks.
Code: Select all
##################################################################
# Email formatting
##################################################################
# SUCCESS
$styleSUCCESS = "<style>BODY{font-family: Arial; font-size: 10pt;}"
$styleSUCCESS = $styleSUCCESS + "TABLE{border: 1px solid black; border-collapse: collapse;}"
$styleSUCCESS = $styleSUCCESS + "TH{border: 1px solid black; background: #4CAF50; color: white; padding: 5px;}"
$styleSUCCESS = $styleSUCCESS + "TD{border: 1px solid black; padding: 5px;}"
$styleSUCCESS = $styleSUCCESS + "</style>"
# FAILED
$styleFAILED = "<style>BODY{font-family: Arial; font-size: 10pt;}"
$styleFAILED = $styleFAILED + "TABLE{border: 1px solid black; border-collapse: collapse;}"
$styleFAILED = $styleFAILED + "TH{border: 1px solid black; background: #FB5A5A; color: white; padding: 5px;}"
$styleFAILED = $styleFAILED + "TD{border: 1px solid black; padding: 5px;}"
$styleFAILED = $styleFAILED + "</style>"
##################################################################
# End User Defined Variables
##################################################################
#################### DO NOT MODIFY PAST THIS LINE ################
Asnp VeeamPSSnapin
[...]
If ($EnableNotification)
{
$TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
$FailedSessions = $TaskSessions | where {$_.status -eq "EWarning" -or $_.Status -eq "EFailed"}
if ($FailedSessions -ne $Null)
{
$EmailTo = $EmailToSUCCESS , $EmailToFAILED
$EmailSubject = $EmailSubjectFAILED
$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}})
$style = $styleFAILED
}
Else
{
$EmailTo = $EmailToSUCCESS
$EmailSubject = $EmailSubjectSUCCESS
$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}})
$style = $styleSUCCESS
}
}
}
If ($EnableNotification)
{
foreach ($EmailTo in $EmailTo)
{
$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)
}
}
7 days.- How many days is "in1week" 6 or 7 days?
The number of backup cycle is irrelevant here. A backup will be deleted in 30 days regardless of how many backup cycles have occurred since the time it was created.- If a backup is made every Sunday with a retention time of "in1month" how many backups should be done before it is removed? 4 or 5? Is it depends on the month?
Thank you for return.v.Eremin wrote:The number of backup cycle is irrelevant here. A backup will be deleted in 30 days regardless of how many backup cycles have occurred since the time it was created.
The test was done on a domain controller server on a test esxi.v.Eremin wrote:Which means that pattern of your source data might not be that suitable for data reduction.
On average we see about 50% of overall data reduction with default settings (deduplication + optimal compression).
Thanks.
Code: Select all
New-Object : Exception calling ".ctor" with "2" argument(s): "Value cannot be null.
Parameter name: from"
At C:\Users\administrator.xxx\Documents\veeamzip.ps1:109 char:12
+ $Message = New-Object System.Net.Mail.MailMessage $EmailFrom, $EmailTo
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationEx
ception
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.
Commands.NewObjectCommand
The property 'Subject' cannot be found on this object. Verify that the property
exists and can be set.
What are the values of $EnableNotification, $SMTPServer, $EmailFrom, $EmailTo, $EmailSubject variables?When I enable email I get a series of errors starting with this
v.Eremin wrote:Which means that pattern of your source data might not be that suitable for data reduction.
On average we see about 50% of overall data reduction with default settings (deduplication + optimal compression).
Thanks.
I bring you the results of the backup on my test server.Azerty wrote:The test was done on a domain controller server on a test esxi.
I recheck the information Monday and I give you details.
Have a nice week end
Yesv.Eremin wrote:Kindly, create a separate topic in general forum and provide your questions there, because they are not related to the given script and being put here they overfill the existing discussion with not related matter.
Thank you for understanding.
Product edition doesn't matter in this case. So, kindly, follow my advice. Thanks.But I use the free version.
You $EncryptionKey variable doesn't appear to contain anything, so I wonder whether you;ve followed steps mentioned in "Encryption" chapter of the original blog post, such as creating secure string, etc.? Thanks.Any ideas, anyone?
Code: Select all
Find-VBRHvEntity : Cannot validate argument on parameter 'Server'. The argument is null.
Provide a valid value for the argument, and then try running the command again.
At D:\batchfiles\VeeamZIPnew_noemail.ps1:76 char:48
+ $VM = Find-VBRHvEntity -Name $VMName -Server $Server
+ ~~~~~~~
+ CategoryInfo : InvalidData: (:) [Find-VBRHvEntity], ParameterBindingValidati
onException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerShell.Comm
and.FindVBRHvEntity
Code: Select all
Start-VBRZip : Cannot validate argument on parameter 'Entity'. The argument is null.
Provide a valid value for the argument, and then try running the command again.
At D:\batchfiles\VeeamZIPnew_noemail.ps1:86 char:40
+ $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $Comp ...
+ ~~~
+ CategoryInfo : InvalidData: (:) [Start-VBRZip], ParameterBindingValidationEx
ception
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerShell.Comm
ands.Backup.StartVBRZip
Users browsing this forum: No registered users and 22 guests