Change job description field via powershell

PowerShell script exchange

Change job description field via powershell

Veeam Logoby pizzim13 » Tue Jul 26, 2011 8:26 pm

Is it possible to change the description field of a job via powershell. Currently, I see it as read only.

Code: Select all
PS C:\> $(Get-VBRJob)[0].description = "test"
"Description" is a ReadOnly property.
At line:1 char:18
+ $(Get-VBRJob)[0]. <<<< description = "test"
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyAssignmentException
pizzim13
Enthusiast
 
Posts: 86
Liked: 6 times
Joined: Thu Apr 21, 2011 7:37 pm

Re: Change job description field via powershell

Veeam Logoby Sethbartlett » Wed Jul 27, 2011 1:06 am

I am currently looking into a way to see if this is doable or how we can get this done for you.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Sethbartlett
Expert
 
Posts: 282
Liked: 25 times
Joined: Wed Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett

Re: Change job description field via powershell

Veeam Logoby Sethbartlett » Wed Jul 27, 2011 12:21 pm

The way to do this is a little odd...but what you can do is the following:
Code: Select all
$job = Get-VBRJob | ?{$_.name -eq "JobName"}
$job.info.Update("jobname", "description")
[Veeam.Backup.Core.CBackupJob]::Update($job.info)


$Job.Info.Update requires 2 arguments, the jobname and the description. This will allow you to set the job description and change the job name of your job.

This means if you want to just change the description, that line would be
Code: Select all
$job.info.update($job.Name, "Description text")
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Sethbartlett
Expert
 
Posts: 282
Liked: 25 times
Joined: Wed Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett

Re: Change job description field via powershell

Veeam Logoby Gostev » Wed Jul 27, 2011 12:51 pm

What a dirty hack Seth ;) this is not really a supported way, for example changing the job name this way can screw up a lot of things.
Right now there is no supported way to set description through API (use the above at your own risk), but I've asked to add this to v6.
Gostev
Veeam Software
 
Posts: 21396
Liked: 2350 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Change job description field via powershell

Veeam Logoby Sethbartlett » Wed Jul 27, 2011 1:04 pm

Completely agreed, I would never use this to change the name of a job :) Powershell is a little too powerful and lets you have duplicates names with your jobs, which is a no no :)
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Sethbartlett
Expert
 
Posts: 282
Liked: 25 times
Joined: Wed Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett

Re: Change job description field via powershell

Veeam Logoby Andreas Neufert » Sun Apr 15, 2012 8:21 pm

@Gostev Hi Anton, I canĀ“t find it in v6. Do you have an idea where to find this? Need this for a customer. Thanks in advance ... CU Andy
Andreas Neufert
Veeam Software
 
Posts: 2201
Liked: 360 times
Joined: Wed May 04, 2011 8:36 am
Location: Germany
Full Name: @AndyandtheVMs Veeam PM

Re: Change job description field via powershell

Veeam Logoby chrmol » Tue Oct 30, 2012 9:21 am

Is it possible to change the content of "description" field in powershell with Veeam 6.5 (in a supported way :D ) ?
chrmol
Enthusiast
 
Posts: 36
Liked: 2 times
Joined: Mon May 17, 2010 7:41 pm
Location: Denmark
Full Name: Christian Moeller


Return to PowerShell



Who is online

Users browsing this forum: Google [Bot] and 11 guests