PowerShell script exchange
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Change job description field via powershell

Post by oleg.feoktistov »

This is currently not possible for VMware and Hyper-V backup/backup copy jobs as they don't have Set-VBR*Job cmdlet pairs. For other ones like NAS, agent, vCloud replica, tape etc. it is totally feasible. Just look for Set-VBR*Job cmdlet for the type you are seeking to manage. Thanks!
AlexWeit
Influencer
Posts: 19
Liked: 1 time
Joined: Apr 04, 2018 9:49 am
Full Name: Alexander Weit
Contact:

Re: Change job description field via powershell

Post by AlexWeit »

+1 for the feature request to allow manipulation of the description field using Powershell!
seb002
Novice
Posts: 3
Liked: never
Joined: Oct 26, 2018 1:45 pm
Full Name: Sébastien
Contact:

[MERGED] Change description of Backup Jobs with Powershell

Post by seb002 »

Hello,

We would like to change the field "Description" for many of our Backup Jobs. But we don't find a way to do that.
I have found an old topic where it says it's not possible to change the name or the description with Powershell because they don't have Set-VBR*Job cmdlet pairs.
Is it still relevant or a solution exists ?

Thanks for the help !
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Change job description field via powershell

Post by oleg.feoktistov » 1 person likes this post

Hi,

Yes, it is still relevant for most of the job types, which don't have set cmdlets with parameters.

Thanks,
Oleg
weeam
Influencer
Posts: 16
Liked: 3 times
Joined: Jan 25, 2019 2:35 pm
Contact:

[MERGED]Update Backup job description with PS

Post by weeam »

Hello guys,

I was unable to find a way to update job description.

Any idea?

Thank you for your support.

Regards,
Eric
Leading Technology
Mildur
Product Manager
Posts: 9848
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Change job description field via powershell

Post by Mildur » 1 person likes this post

Hi Eric

I moved your question to this post.
Currently, it's not possible for HyperV and VmWare Backup Jobs to change the description with PowerShell.
If you requested this for one of this two jobs, we will surely count your request as +1.
oleg.feoktistov wrote: May 20, 2021 10:32 am This is currently not possible for VMware and Hyper-V backup/backup copy jobs as they don't have Set-VBR*Job cmdlet pairs. For other ones like NAS, agent, vCloud replica, tape etc. it is totally feasible. Just look for Set-VBR*Job cmdlet for the type you are seeking to manage. Thanks!
Thanks
Fabian
Product Management Analyst @ Veeam Software
eduzimrs
Service Provider
Posts: 56
Liked: 7 times
Joined: Jul 25, 2018 5:08 pm
Full Name: Eduardo Scheffer
Location: Florianopolis - Brazil
Contact:

Re: Change job description field via powershell

Post by eduzimrs »

Hi Guys,

Any updates to change the Job Description via PS? That would be helpful.
Thanks.
--
Best Regards.
Eduardo K. Scheffer - SE
eduzimrs
Service Provider
Posts: 56
Liked: 7 times
Joined: Jul 25, 2018 5:08 pm
Full Name: Eduardo Scheffer
Location: Florianopolis - Brazil
Contact:

Re: Change job description field via powershell

Post by eduzimrs »

Hi,

Still no way to change the description via PS?
Thanks.
--
Best Regards.
Eduardo K. Scheffer - SE
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Change job description field via powershell

Post by oleg.feoktistov »

Hi Eduardo,

Not for Hyper-V, VMware and some other types, as I explained above. But we plan to update old job cmdlets in one of post-v12 major releases.

Thanks,
Oleg
mattbrown80
Service Provider
Posts: 57
Liked: 16 times
Joined: Nov 26, 2014 9:34 pm
Full Name: Matt Brown
Contact:

Re: Change job description field via powershell

Post by mattbrown80 »

Hello

Any change to this functionality? Is there a Cmdlet that can adjust the job's description?

Thanks
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Change job description field via powershell

Post by oleg.feoktistov » 1 person likes this post

Hi Matt,

As I mentioned above, the change is planned for one of the next major post-v12 versions (v13+). Nothing has changed in this regard.

Best regards,
Oleg
r.ladrak
Lurker
Posts: 1
Liked: never
Joined: Nov 12, 2020 6:20 pm
Full Name: Rutger Ladrak
Contact:

Re: Change job description field via powershell

Post by r.ladrak »

Hi All,
Seems to be a hot topic on changing the Job description using powershell.

You can update the description using the following code:

Code: Select all

$Description = <Some tekst - Not Null or Empty>
$Jobname = <Name of the BackupJob>
$SQlSrv = <Name of SQL-Server>
$SQLDb = <Name of Veeam Database - Usually VeeamBackup>
$Credentials = Get-credential  #Credentials to connect to the database server
$jobId  = (Get-VBRJob -name $Jobname).Info.id.tostring()

$SQl_Session = New-psSession -ComputerName $SQlSrv -Credential $Credentials

$SB_UpdateSQL = {
	Param([string]$DbServer,[string]$DbName,[string]$JobId,[string]$Description)

	Try
	{
		$SqlConnStr   = "Server={0};database={1};Integrated Security=true; trusted_connection=true" -f $DbServer,$DbName
		$Update_Query = "UPDATE [dbo].[BJobs] SET [description] = '"+ $Description +"' WHERE id = '"+ $JobId +"'"
		
		$conn = New-Object System.Data.SqlClient.SQLConnection
		$conn.ConnectionString = $SqlConnStr
		$conn.Open()
		Write-host "INFO:`tConnected to SQL server: $($DbServer)"
		Write-host "INFO:`tExecuting query: $($Update_Query)"
		
		$Update_Cmd     = New-Object system.Data.SqlClient.SqlCommand($Update_Query,$conn)
		$rowsAffected   = $Update_Cmd.ExecuteNonQuery() 
		$conn.close()
		Write-Host "INFO:`t Rows Affected by Update = $($rowsAffected)" 
	}
	Catch
	{
		Write-host "-------------------------------------------------"
		Write-host "Error found while executing this command:"
		Write-host "$($_.InvocationInfo.line)" -ForegroundColor Yellow
		Write-host "Script PositionMessge:"
		Write-host "$($_.InvocationInfo.PositionMessage)" -ForegroundColor Yellow
		Write-host "Exception error:"
		Write-host "$($_.Exception.Message)" -ForegroundColor Red
		Write-host "-------------------------------------------------"
		Return "WARNING: Unable to connect to the SQL-server. Try to Fix the problem and try again! "
	}
}

Invoke-Command -Session $SQl_Session -ScriptBlock $SB_UpdateSQL -ArgumentList ($SQlSrv, $SQLDB, $jobId, $Description)
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests