Maintain control of your Microsoft 365 data
Post Reply
sumeet
Service Provider
Posts: 273
Liked: 53 times
Joined: Apr 23, 2021 6:40 am
Full Name: Sumeet P
Contact:

After upgrade v8.4 Invoke-WebRequest fails

Post by sumeet »

After upgrade v8.4 Invoke-WebRequest fails - I'm still investigating this, but want to check if anyone else has faced this.

We have power-shell scripts that we use for monitoring, by using Invoke-WebRequest.
Below is the snippet code. I know the version is v6, but this works fine for v8.3 and according to doco, previous two versions is supported.
Checked the doco - https://helpcenter.veeam.com/references ... t/tag/Auth
do not see anything that can raise red flags

Anyone else run into this problem?

$apiver = '/v6'
#region: Authenticate
$url = '/Token'
$body = @{
"username" = $username;
"password" = $password;
"grant_type" = "password";
}
$headers = @{
"Content-Type"= "application/x-www-form-urlencoded"
}
$jsonResult = Invoke-WebRequest -Uri $apiUrl$apiver$url -Body $body -Headers $headers -Method Post

After v8.4 upgrade, the above invocation fails with the below error -
Invoke-WebRequest : The remote server returned an error: (403) Forbidden.
Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests