how to use checkurl with windows ad account?

+1 vote
asked Dec 1, 2017 in EventSentry SysAdmin Tools by Jianhua Zhou (130 points)
Hi, I tried to check url that has windows authentication. The command is checkurl  /u domain_name\account /p password https://web_server_name/webapp_name

It returned HTTP protocol error. 401 Unauthorized." (151) and the username and password could not be processed by the checkurl.

Please help.

1 Answer

+2 votes
answered Dec 4, 2017 by Sally (2,460 points)

Hi, does it work if you try instead of yourdomain\accountname?

If not, if you use a browser and visit that exact URL (https://web_server_name/webapp_name) does it direct you to a logon page or does it display the page to any authorized user without ever logging on?

If it directs you to a logon page, but the page is hosted on a different server (such as web_server_name2) checkurl is not compatible with that.

If it directs you to a logon page, and the page is hosted on the same server, there is a special way that you have to set up your checkurl command.  Please note that this is one big line of command despite what the forum makes it look like:

checkurl.exe /loginpage http://web_server_name/logon-submit-page-goes-here /loginformdata accountfieldname=accountname,passwordfieldname=passwordtext /timeout 60 /lc http://url-you-want-to-monitor

To obtain the "logon-submit-page-goes-here" value please go to the logon page in a browser and press F12 to enter developer mode.  Search for "submit=" or "action="(without quotes) and the URL listed there is the "logon-submit-page-goes-here" value to put in checkurl.  The "accountfieldname" and "passwordfieldname" values can also be found in there, by searching for whichever name is displayed next to the fields, such as "username" or "account" or "password".  Once you have the logon submit page, the accountfieldname, and the passwordfieldname, this should allow checkurl to successfully log onto your site and monitor your page successfully. 

commented Dec 5, 2017 by Joe
Thanks very much for the help. I tired and it still returned 401 unauthorized error.
Welcome to EventSentry Q&A, where you can ask questions and receive answers from other members of the community.