Powershell script to check specifically if the url redirect is to login page instead of redirect in general

Prabha 66 Reputation points
2021-11-16T14:16:01.16+00:00

I have the below code that redirects the url (used -MaximumRedirection 0) to a normal. My concern is to check specifically if the url redirect is to login page instead of redirect in general. Is that possible?

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,627 questions
No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Rich Matheisen 35,266 Reputation points
    2021-11-16T19:36:09.967+00:00

    Wouldn't a "Redirect" response code fall in the 3xx range?


  2. Limitless Technology 37,351 Reputation points
    2021-12-16T18:17:44.947+00:00

    I think it's important for you to refer to the article below on "Redirect URI (Response URL) Restrictions and Limitations" which will help you to better understand what is possible and what is not in the scenario you are facing:

    https://learn.microsoft.com/en-us/azure/active-directory/develop/reply-url

    ----

    --If the answer is helpful, please vote positively and accept the answer--

    No comments