Share via

automate getting html from Windows Authentication secured site

Nikolay KARETNIKOV 1 Reputation point
2022-07-15T08:52:08.957+00:00

Hello!
There’s this application that is managed via a web portal http://localhost/appname/admin
Site is hosted on IIS. The page requires authentication. IIS Authentication settings are as follows: Windows Authentication “Enabled”, Basic Authentication “Disabled”, ASP.NET Impersonalisation “Disabled”, Anonymous Authentication “Enabled”.
Once I login into the system using an AD account, I can browse the portal and get some data. The aim is to automate getting a data from about 1k pages via either powershell or C# code. The problem is that I can not get through the authentication page.
I’m thinking 2 ways. 1. to authenticate in the code itself, 2. to use already established by browser session. But with almost zero experience, I’m stuck. Would someone suggest a way to handle the situation

Windows development | Internet Information Services

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.