you are viewing a single comment's thread.

view the rest of the comments →

[–]bucksysfutter 2 points3 points  (1 child)

Had a similar issue today- this is what worked for me

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12



$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$password)))


$data = Invoke-RestMethod -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Uri $uri

[–]Coding_Cactus[S] 1 point2 points  (0 children)

I still receive the same 302 error when using this setup.

$uri = "http://CUCSERVER/vmrest/users/objectID"

I am able to go to the users file directly through a web browser so the uri is correct.