-
- Lurker
- Posts: 2
- Liked: never
- Joined: Jul 20, 2015 3:39 pm
- Full Name: Steve Newton
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Hello,
Can anyone shed some light on why I get this error?
Start-VBRZip : A parameter cannot be found that matches parameter name 'AutoDelete'.
At C:\PowerShell Scripts\VeeamZIPaldc1.ps1:86 char:132
+ ... leQuiescence) -AutoDelete $Retention
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Start-VBRZip], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Veeam.Backup.PowerShell.Commands.Backup.StartVBRZip
You cannot call a method on a null-valued expression.
At C:\PowerShell Scripts\VeeamZIPaldc1.ps1:91 char:5
+ $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
If I take out "autodelete" it works.
Can anyone shed some light on why I get this error?
Start-VBRZip : A parameter cannot be found that matches parameter name 'AutoDelete'.
At C:\PowerShell Scripts\VeeamZIPaldc1.ps1:86 char:132
+ ... leQuiescence) -AutoDelete $Retention
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Start-VBRZip], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Veeam.Backup.PowerShell.Commands.Backup.StartVBRZip
You cannot call a method on a null-valued expression.
At C:\PowerShell Scripts\VeeamZIPaldc1.ps1:91 char:5
+ $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
If I take out "autodelete" it works.
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
What product and PowerShell version are you using?
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Jul 20, 2015 3:39 pm
- Full Name: Steve Newton
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Thanks but I upgraded veeam and powershell and it seems to be working.
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Hi, Steve,
That's the main reason why the referenced script doesn't seem to work - either PS or backup server version is a bit out-dated one.
Anyway, glad to hear that now everything is up and running.
Thanks.
That's the main reason why the referenced script doesn't seem to work - either PS or backup server version is a bit out-dated one.
Anyway, glad to hear that now everything is up and running.
Thanks.
-
- Novice
- Posts: 3
- Liked: never
- Joined: Aug 18, 2015 1:45 pm
- Full Name: Erin Steadman
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Will this work with PowerShell version 4? That's the only thing that's different. I've applied Update 2. This is the first error being reported
Thanks
Erin
Code: Select all
Asnp : No snap-ins have been registered for Windows PowerShell version 4.
At C:\VeeamSentry.ps1:69 char:1
+ Asnp VeeamPSSnapin
Erin
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
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.Will this work with PowerShell version 4?
-
- Novice
- Posts: 3
- Liked: never
- Joined: Aug 18, 2015 1:45 pm
- Full Name: Erin Steadman
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
I'll try reinstalling the update. Just waiting for a backup to finish PS Snap-in is included in Update 2b, right?
Support ID 00999684 it's an old one, but it won't let me post without an ID. Stupid
Thanks
Support ID 00999684 it's an old one, but it won't let me post without an ID. Stupid
Thanks
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
-
- Novice
- Posts: 3
- Liked: never
- Joined: Aug 18, 2015 1:45 pm
- Full Name: Erin Steadman
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Still no luck. Same error. Any other ideas?
Support ID 00999684
Support ID 00999684
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Let's wait till support team analyze the corresponding logs, then. They'll be able to find out the root cause of the experienced behaviour. Thanks.
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Aug 25, 2015 11:32 am
- Full Name: richard mount
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Please forgive my excessive noob-ness. I had this running a treat for a while, customer was loving it, I was loving it. It appears that the trial license that it made me install has expired and I am unable to get a backup running again.
Error message is:
Is there a way to remove this, revert back to the free edition (I have set the UI to the Free Functionality only not the Full functionality) but so far am unable to get rid of this trial license restriction.
Sorry if this post hurts your head with its stupidity but we've been trying to sort this for 3 weeks.
Thanks
Error message is:
Code: Select all
PS C:\Dynamic_Scripts> .\Veeam-SAS-DC.ps1
Start-VBRZip : Your trial license has expired.
To continue using the product, please purchase a full license.
To purchase a full license, please submit a request at http://www.veeam.com/sales
A sales representative will contact you shortly after your request has been received.
At C:\Dynamic_Scripts\Veeam-SAS-DC.ps1:86 char:19
+ $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $Comp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Start-VBRZip], CLicenseException
+ FullyQualifiedErrorId : Veeam.Backup.LicenseLib.CLicenseException,Veeam.Backup.PowerShell.Commands.Backup.StartV
BRZip
Sorry if this post hurts your head with its stupidity but we've been trying to sort this for 3 weeks.
Thanks
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Hmm, I don't think that I've tested the script against deployment that has trial license expired.
If possible, I'd recommend re-installing backup server from a scratch and not specifying any license during installation (that should make installation free edition from the beginning).
Thanks.
If possible, I'd recommend re-installing backup server from a scratch and not specifying any license during installation (that should make installation free edition from the beginning).
Thanks.
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Aug 25, 2015 11:32 am
- Full Name: richard mount
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Cheers for the reply, I'll give that a go. Many thanks.
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Kindly, let me know how the process goes and whether the issue persists after re-installation. Thanks.
-
- Lurker
- Posts: 2
- Liked: 1 time
- Joined: Aug 26, 2015 3:10 pm
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Hello, I'm new to Veeam and wanted to try out the PowerShell script being talked about here. Unfortunately, it looks like the download links are all dead, along with most of the screen-shots in the shown in the blog post. Does anyone happen to have a copy of the script on hand?
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Sorry for a late reply. I must have missed your post.
Anyway, the blog post as well as links it contains seems to be good. They even have been updated recently to address few previously existed inconsistencies. So, kindly check them, if you haven't done it already.
Thanks.
Anyway, the blog post as well as links it contains seems to be good. They even have been updated recently to address few previously existed inconsistencies. So, kindly check them, if you haven't done it already.
Thanks.
-
- Lurker
- Posts: 2
- Liked: 1 time
- Joined: Aug 26, 2015 3:10 pm
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Ah, so they are. Thank you.v.Eremin wrote:Sorry for a late reply. I must have missed your post.
Anyway, the blog post as well as links it contains seems to be good. They even have been updated recently to address few previously existed inconsistencies. So, kindly check them, if you haven't done it already.
Thanks.
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
You're welcome. Should any help with scripting be needed, kindly, let me know. Thanks.
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Sep 24, 2015 10:22 am
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Hi there,
Hope you can help with this - apologies if it's something that's already been discussed.
I am trying to run the hyper-v script as a scheduled task. Veeam v8 is installed on a Server2012 instance, with the Hyper V role installed. Powershell v3.
The script returns the following output when run:
Hope someone can assist!
Cheers
Hope you can help with this - apologies if it's something that's already been discussed.
I am trying to run the hyper-v script as a scheduled task. Veeam v8 is installed on a Server2012 instance, with the Hyper V role installed. Powershell v3.
The script returns the following output when run:
Code: Select all
Find-VBRHvEntity : Cannot validate argument on parameter 'Server'. The argument is null. Supply a non-null
argument and try the command again.
At C:\VeeamZIPHV.ps1:77 char:48
+ $VM = Find-VBRHvEntity -Name $VMName -Server $Server
+ ~~~~~~~
+ CategoryInfo : InvalidData: (:) [Find-VBRHvEntity], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerShell.Command.FindVBRHvEnti
ty
Start-VBRZip : Cannot validate argument on parameter 'Entity'. The argument is null. Supply a non-null
argument and try the command again.
At C:\VeeamZIPHV.ps1:87 char:40
+ $ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $Comp ...
+ ~~~
+ CategoryInfo : InvalidData: (:) [Start-VBRZip], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerShell.Commands.Backup.Start
VBRZip
You cannot call a method on a null-valued expression.
At C:\VeeamZIPHV.ps1:92 char:5
+ $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Cheers
-
- Novice
- Posts: 3
- Liked: never
- Joined: Sep 24, 2015 1:15 pm
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
@TC1927
I originally had the same issue with $Server coming up null. The only way I could get it working was by setting $HostName variable to "LOCALHOST" instead of the actual host name. Might be worth using as a workaround if you're only going to run locally as I am.
I also have my own issue I'm looking for help with:
I have a working script and am jolly about it. Working, that is, as long as I run it manually from PowerShell or from Posh ISE. If I try to run it with Task Scheduler, I get an error about the encryption key. I used Start-Transcript to get the below log when running the script as a SchedTask.
I have a text file with password that I reference in the variable for $EncryptionKey. Again, the script works when I run manually but not when run via Task Scheduler. Task setup: Run with local admin-level account, highest priv=yes. Saving the backups locally so no issue there.
Any help is appreciated.
I originally had the same issue with $Server coming up null. The only way I could get it working was by setting $HostName variable to "LOCALHOST" instead of the actual host name. Might be worth using as a workaround if you're only going to run locally as I am.
I also have my own issue I'm looking for help with:
I have a working script and am jolly about it. Working, that is, as long as I run it manually from PowerShell or from Posh ISE. If I try to run it with Task Scheduler, I get an error about the encryption key. I used Start-Transcript to get the below log when running the script as a SchedTask.
Code: Select all
ConvertTo-SecureString : Key not valid for use in specified state.
At C:\scripts\vm-backup.ps1:81 char:75
+ $EncryptionKey = Add-VBREncryptionKey -Password (cat $EncryptionKey | Conver ...
+ ~~~~~~
+ CategoryInfo : InvalidArgument: (:) [ConvertTo-SecureString], CryptographicException
+ FullyQualifiedErrorId : ImportSecureString_InvalidArgument_CryptographicError,Microsoft.PowerShell.Commands.Conv
ertToSecureStringCommand
PS>TerminatingError(Add-VBREncryptionKey): "Cannot validate argument on parameter 'Password'. The argument is null. Provide a valid value for the argument, and then try running the command again."
Add-VBREncryptionKey : Cannot validate argument on parameter 'Password'. The argument is null. Provide a valid value
for the argument, and then try running the command again.
At C:\scripts\vm-backup.ps1:81 char:53
+ $EncryptionKey = Add-VBREncryptionKey -Password (cat $EncryptionKey | Conver ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Add-VBREncryptionKey], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerShell.Command.AddVBREncryptionKey
Any help is appreciated.
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Sep 24, 2015 10:22 am
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
@jbilt2
Thanks for the response - I haven't tried this yet but I'm not sure if it's the answer as the machine running Hyper-V and containing the VMs are separate physical boxes to the one running Veeam.
# Name of vCenter or standalone host VMs to backup reside on (Mandatory)
As I read it, the $Hostname should be the name of your Hyper-V host, which in this case is a remote host rather than local.
As for your issue - have you tried it without encryption (ie encryption = $false) ?
Thanks again
Thanks for the response - I haven't tried this yet but I'm not sure if it's the answer as the machine running Hyper-V and containing the VMs are separate physical boxes to the one running Veeam.
# Name of vCenter or standalone host VMs to backup reside on (Mandatory)
As I read it, the $Hostname should be the name of your Hyper-V host, which in this case is a remote host rather than local.
As for your issue - have you tried it without encryption (ie encryption = $false) ?
Thanks again
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
What name you're specifying as a $HostName variable? Are you positive the host is added to a backup console under the very same name that is setup as $HostName variable?TC1927 wrote:The script returns the following output when run:
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Have you followed instructions provided in the corresponding blog post ("Encryption" section) on how encryption key should be created? Also, if I remember correctly, to make encryption work properly, the account under which secure key has been created should be the same as the account under which the script is executed. Thanks.jbilt2 wrote:I have a working script and am jolly about it. Working, that is, as long as I run it manually from PowerShell or from Posh ISE. If I try to run it with Task Scheduler, I get an error about the encryption key. I used Start-Transcript to get the below log when running the script as a SchedTask.
-
- Novice
- Posts: 3
- Liked: never
- Joined: Sep 24, 2015 1:15 pm
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Indeed it seems this was my problem. I had created the key with my user but was running the scheduled task as a local user (admin). Recreating the key with the local account allowed the script to run successfully.v.Eremin wrote:Also, if I remember correctly, to make encryption work properly, the account under which securekey has been created should be the same as the account under which the script is executed. Thanks.
But this raises a question/concern about this concept: how does this relate to restoration & decryption of the backup files? Is this user account the only one that will be able to decrypt the data? And a secondary question: if I had used a domain account, would the key be portable to other hosts? Or is the SecureKey not only user-specific, but also machine-specific?
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
When you try to restore an encrypted backup file, you'll be asked to enter a corresponding password. So, a person knowing a password will be able to restore the data.But this raises a question/concern about this concept: how does this relate to restoration & decryption of the backup files? Is this user account the only one that will be able to decrypt the data?
I think it's a user-specific, but haven't tested that myself. It should be pretty easy to check, though, just copy a corresponding file to a different machine, log on into it, using the same account, try to run a script and see whether you encounter any issue.And a secondary question: if I had used a domain account, would the key be portable to other hosts? Or is the SecureKey not only user-specific, but also machine-specific?
Thanks.
-
- Novice
- Posts: 5
- Liked: never
- Joined: Oct 05, 2015 9:27 am
- Full Name: anv
- Contact:
[MERGED] : Backup fo LAN
Hello! I can make BACKUP for LAN use console (without powershell).I use credentials for access to LAN share. How can I use this paramete in Powershell? Thank you!!!
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Backup fo LAN
What specific issue you get while trying to backup to a specific share via PS? Can you please post a portion of code that fails? Have you tried to map a given share, using New-PSDrive commandlet? Also, does a computer account a script gets executed from has a write permission on the said share? Thanks.
-
- Novice
- Posts: 5
- Liked: never
- Joined: Oct 05, 2015 9:27 am
- Full Name: anv
- Contact:
Re: Backup fo LAN
When I try to create backup on network share I receive the error, thus the user to run the script created in the network globe,access full
I try to use New-PSDrive , but it was problem with login and password. THANK you!!!
Code: Select all
You cannot call a method of the expression with the value NULL.
D:\Veeam\VeeamZIP-BACKUP.ps1:41 знак:54
+ {$TaskSessions = $ZIP.GetTaskSessions().logger.getlog <<<< ().updatedrecords
+ CategoryInfo : InvalidOperation: (getlog:String) [], RuntimeExc
eption
+ FullyQualifiedErrorId : InvokeMethodOnNull
-
- Novice
- Posts: 5
- Liked: never
- Joined: Oct 07, 2015 7:30 am
- Full Name: David Gacias
[MERGED] : Unable to backup via powershell
Hi folks! I have been working on this script to backup all my standalone Hyper-V Server host for 2 days and i am still unable to do backups of my VM's with Veeam via powershell.
It's a modified Script of Vladimir Eremin with some write-hosts and modified to work with Hyper-V.
The script Output is this:
I cancelled at this point, every VM fails the same.
It's a modified Script of Vladimir Eremin with some write-hosts and modified to work with Hyper-V.
Code: Select all
Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
# 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 = (get-vm -ComputerName HATHOR | foreach { $_.Name })
#$VMNames = ""
# Name of vCenter or standalone host VMs to backup reside on (Mandatory)
$HostName = "128.64.80.56"
# Directory that VM backups should go to (Mandatory; for instance, C:\Backup)
$Directory = "Z:\"
#(Z:\ is a maped network share)
# 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 = "TomorrowNight"
##################################################################
# Notification Settings
##################################################################
# Enable notification (Optional)
$EnableNotification = $True
# Email SMTP server
$SMTPServer = "smtp.mycompany.com"
# Email FROM
$EmailFrom = "hathor@mycompany.com"
# Email TO
$EmailTo = "myname@mycompany.com"
# Email subject
$EmailSubject = "HATHOR BACKUP REPORT"
##################################################################
# 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 ################ I DID!!!
write-host "Iniciando backups..."
Asnp VeeamPSSnapin
write-host "Recopilando información del Hipervisor $HostName..."
$Server = Get-VBRServer -name $HostName
$MesssagyBody = @()
write-host "Hecho."
foreach ($VMName in $VMNames)
{
Write-Host "Recopilando información de la VM $VMName..."
$VM = Find-VBRHvEntity -Name $VMName -Server $Server
Write-Host "Recopilada."
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
{
Write-host "Inicio del backup de $VMName..."
$ZIPSession = Start-VBRZip -Entity $VMName -Folder $Directory -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention
Write-host "Terminado."
}
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)
}
Code: Select all
PS C:\Users\Administrator> C:\Users\Administrator\Desktop\VeeamZIP (HV).ps1
Iniciando backups...
Recopilando información del Hipervisor 128.64.80.56...
Hecho.
Recopilando información de 2012R2HATHOR...
Recopilada.
Inicio del backup de 2012R2HATHOR...
Start-VBRZip : Cannot bind parameter 'Entity'. Cannot convert the "2012R2HATHOR" value of type "System.String" to type "Veeam.Backup.Common.IItem".
At C:\Users\Administrator\Desktop\VeeamZIP (HV).ps1:98 char:40
+ $ZIPSession = Start-VBRZip -Entity $VMName -Folder $Directory -Compression $ ...
+ ~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Start-VBRZip], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Veeam.Backup.PowerShell.Commands.Backup.StartVBRZip
Terminado.
You cannot call a method on a null-valued expression.
At C:\Users\Administrator\Desktop\VeeamZIP (HV).ps1:104 char:5
+ $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Recopilando información de C0124_Mizar_Portatil_146...
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Discussion on blog post: Update 2 featuring PowerShell
Seems like a $ZIP variable doesn't contain anything, as the result you get the said error. Will the script work if you change target to local disk temporarily?anv wrote:When I try to create backup on network share I receive the error
I was not talking about an user running a script, but rather about computer account that should have write permissions on the share. Otherwise, you'd get Access Denied message (kindly, check the thread your post has been merged into).anv wrote:The user to run the script created in the network globe,access full
What particular error you got?anv wrote:I try to use New-PSDrive , but it was problem with login and password.
Thanks.
Who is online
Users browsing this forum: aruns and 9 guests