Browse Community
Help
Log In
Responses(1)
Solutions(0)
ChrisVH
2 Posts
0
May 31st, 2022 08:00
Found the issue. The following script does the trick:
$credential = Get-Credential # Enter like this: DOMAIN\Username$password = $credential.GetNetworkCredential().password$username = $credential.GetNetworkCredential().UserName$domain = $credential.GetNetworkCredential().domain$credPair = "$($domain)\$($username):$($password)"$encodedCredentials = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($credPair))
$headers = @{ Authorization = "Basic $encodedCredentials";"Accept" = "application/json";"Content-Type" = "application/json"}
Invoke-RestMethod -Method Get -Uri 'https://PluginServer.FQDN/api/v1/vms?fields=name,status' -Headers $headers
Dell Support Resources
View All
Top
ChrisVH
2 Posts
0
May 31st, 2022 08:00
Found the issue. The following script does the trick:
$credential = Get-Credential # Enter like this: DOMAIN\Username
$password = $credential.GetNetworkCredential().password
$username = $credential.GetNetworkCredential().UserName
$domain = $credential.GetNetworkCredential().domain
$credPair = "$($domain)\$($username):$($password)"
$encodedCredentials = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($credPair))
$headers = @{
Authorization = "Basic $encodedCredentials";
"Accept" = "application/json";
"Content-Type" = "application/json"
}
Invoke-RestMethod -Method Get -Uri 'https://PluginServer.FQDN/api/v1/vms?fields=name,status' -Headers $headers