REST API knowledge exchange
Post Reply
ingenieria
Novice
Posts: 5
Liked: never
Joined: Dec 16, 2022 8:56 am
Full Name: Cristina Ruiz
Contact:

Update password of Backup Servers in Enterprise Manage with a script

Post by ingenieria »

Good Morning,

It is possible to update the password of the Backup Servers registered in the Veeam Backup Enterprise Manager with a Script? We are using the Veeam API to connect with the Backup Server, but when the password is changed, we need to update it manually.

Thanks

Cristina
ronnmartin61
Veeam Software
Posts: 541
Liked: 195 times
Joined: Mar 07, 2016 3:55 pm
Full Name: Ronn Martin
Contact:

Re: Update password of Backup Servers in Enterprise Manage with a script

Post by ronnmartin61 »

I've not personally tried it but it appears to be supported via PUT /backupServers/{ID}/credentials/{ID} see https://helpcenter.veeam.com/docs/backu ... ml?ver=110

or more simply - PUT /backupServers/{ID} https://helpcenter.veeam.com/docs/backu ... ml?ver=110
oleg.feoktistov
Veeam Software
Posts: 2011
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Update password of Backup Servers in Enterprise Manage with a script

Post by oleg.feoktistov »

To be precise, you can update backup server password with the latter request Ronn shared. The first is for updating credentials you use for your backup infrastructure in scope of a single backup server. Thanks!
ingenieria
Novice
Posts: 5
Liked: never
Joined: Dec 16, 2022 8:56 am
Full Name: Cristina Ruiz
Contact:

Re: Update password of Backup Servers in Enterprise Manage with a script

Post by ingenieria »

Thanks to all! I am going to try it and let you know

Thanks!
Cristina
ingenieria
Novice
Posts: 5
Liked: never
Joined: Dec 16, 2022 8:56 am
Full Name: Cristina Ruiz
Contact:

Re: Update password of Backup Servers in Enterprise Manage with a script

Post by ingenieria »

Hi!

Sorry for the late response. We tried it, but when we execute the following call:

$Response = Invoke-WebRequest -URI https://XXXXXXXX:9398/api/backupServers ... XXXXXXXXXX -Method 'PUT' -Headers @{'Accept' = 'application/json'; 'X-RestSvcSessionId' = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'} -Body ($body|ConvertTo-Json)

$body = @{
    "Password" = "XXXXXXX",
    "DnsNameOrIpAddress" = "XXXXXXXXXX",
    "Description" = "",
    "Port" = 9392,
    "Username" = "XXXXXXXXXXX"
}


We are receiving the following error:

"Invoke-WebRequest : {"FirstChanceExceptionMessage":null,"StackTrace":null,"Message":"Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details.","StatusCode":500,"Status":"InternalServerError"}
At line:1 Char:13
+CategoryInfo: InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+FullyQualifiedErrorId: WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand


Do you know what this error means? We are stuck on this :(

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

Re: Update password of Backup Servers in Enterprise Manage with a script

Post by oleg.feoktistov »

Hi Cristina,

The error code looks quite generic, so cannot tell for sure what was it that the server couldn't process.
However, in the code you shared I noticed that you put commas after each key/value pair in body hashtable.
Commas are redunant there, just put an indentation or ";" if you write all in one line.
It might be the reason for the error, but then it's weird that in my lab powershell throws exceptions on hashtable reading step, not on sending out the request.


Thanks,
Oleg
ingenieria
Novice
Posts: 5
Liked: never
Joined: Dec 16, 2022 8:56 am
Full Name: Cristina Ruiz
Contact:

Re: Update password of Backup Servers in Enterprise Manage with a script

Post by ingenieria »

Hi Oleg!

Thank you for your reply. We tried with ";" but the result is the same... :(

I don't know what we are doing wrong.

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

Re: Update password of Backup Servers in Enterprise Manage with a script

Post by oleg.feoktistov »

Hi Cristina,

The same request worked fine in my lab. The error is pretty generic, so I think it would be the best to check the logs.
Could you please contact our support team and share case id here?

Best regards,
Oleg
ingenieria
Novice
Posts: 5
Liked: never
Joined: Dec 16, 2022 8:56 am
Full Name: Cristina Ruiz
Contact:

Re: Update password of Backup Servers in Enterprise Manage with a script

Post by ingenieria »

Hi Oleg,

We opened a case support with this and they told us that open a forum case was the best option for that.

Where we can I find the logs for that? To check it with them.

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

Re: Update password of Backup Servers in Enterprise Manage with a script

Post by oleg.feoktistov »

Hi Cristina,

Specifically EM REST logs are available here:
C:\ProgramData\Veeam\Backup\Svc.VeeamRestApi.log

But the error is quite generic, so other logs from Enterprise Manager might be needed.
Check this article on where to get them.

Thanks,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests