Skip to content

Instantly share code, notes, and snippets.

@iSnackyCracky
Created September 24, 2022 18:01
Show Gist options
  • Save iSnackyCracky/f9bf02d401ce24df5c067e60abcddfae to your computer and use it in GitHub Desktop.
Save iSnackyCracky/f9bf02d401ce24df5c067e60abcddfae to your computer and use it in GitHub Desktop.
Send Autodiscover WebRequest using PowerShell for debugging purposes.
$request = @"
<?xml version="1.0"?>
<Autodiscover xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006">
<Request>
<EMailAddress>[email protected]</EMailAddress>
<AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a</AcceptableResponseSchema>
</Request>
</Autodiscover>
"@
$cred = Get-Credential
(Invoke-WebRequest -Uri https://exchange.example.com/Autodiscover/Autodiscover.xml -Credential $cred -Method post -Body $request -ContentType 'text/xml').Content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment