Accessing a web service behind a TMG Server RRS feed

  • Question

  • I'd like to access a SharePoint web service behind a TMG server. The TMG server requires form based authentication and I'm not able to get past that. This is what I've tried:

    $pwd=Read-Host -AsSecureString

    $body = @{
    $response=Invoke-RestMethod -Uri $loginurl -Method Post -Body $body

    I then plan to use the cookie to access the web service:

    $Url = "'TestList')/items"

    $header = @{

     'token' = 'TokenValueFromPreviousResponse'


    Invoke-RestMethod -Method Post -Uri $Url -Header $header | ft

    I can't get the first part working. I also had a look at this blog post but it doesn't give much details:

    Any help appreciated.

    • Moved by Bill_Stewart Thursday, August 1, 2019 1:19 PM Move to more appropriate forum
    Thursday, August 1, 2019 3:33 AM