What am I missing here? I'm getting this error

  • 17 November 2020
  • 2 comments
  • 273 views

Userlevel 1
Badge

Backup job: mwc-appsvr-midtier_2020-11-17T095355 (Full)

Error

1 of 1 VMs processed

17 November 2020 09:53:55 AM

Success

0

Start time

09:53:55 AM

Total size

0 B

Backup size

0 B

Processing mwc-appsvr-midtier Error: Access is denied.
Could not perform threshold check for backup location "\\10.0.0.12\Backup\VirtualMachines\Autobackups" due to space info retrievement fail!

Warning

0

End time

09:54:35 AM

Data read

0 B

Dedupe

1.0x

Error

1

Duration

0:00:39

Transferred

0 B

Compression

1.0x

Details

Name

Status

Start time

End time

Size

Read

Transferred

Duration

Details

mwc-appsvr-midtier

Error

09:54:17 AM

09:54:31 AM

0 B

0 B

0 B

0:00:13

Error: Access is denied.

 

# Names of VMs to backup separated by comma (Mandatory). For instance, $VMNames = “VM1”,”VM2”
$VMNames = "mwc-4me-hub","mwc-app1-20.02","mwc-app2-20.20","mwc-appsvr-midtier","mwc-PostgreSQL10","mwe_co_za","MWE_CSP_BS_DEV","MWE_SmartSite_SmartReporting","MWE_Web_Svr_Prod","za-jhb-mwc-ws","za-mwc-jnb-dc01"

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

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

# 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 = $False

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

# 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 = "smtp.office365.com"

# Email FROM
$EmailFrom = "system@metaweave.co.za" 

# Email TO
$EmailTo = "prof.msibi@metaweave.co.za"

# Email subject
$EmailSubject = "Backup Notification from Veeam Automated Backup"

##################################################################
#                   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)
}

 

what am i missing here im getting the above errror


2 comments

Userlevel 7
Badge +13

How do you manage authentication to your $Directory? Do you start the script via scheduler? If so, you may use a “wrong” user there?

Userlevel 7
Badge +14

You might want to remove/hide the e-mails inside your post. On to the topic, “Access denied” looks like there could be a permissions issue. Is it correct “\\10.0.0.12\Backup\VirtualMachines\Autobackups" is your CIFS/SMB backup repository?

Comment