Hi, I´ve tried now many different ways, to authenticate against a web-server, i found on the web. One of them is this:
use HTTP::Request::Common; use LWP::Debug qw(+); use strict; use warnings; my $url = "http://********.com/MBSDKService/MsgSDK.asmx?WSDL.RunQuery? +queryName=physical_windows_servers_itop_query"; my $ua = new LWP::UserAgent(keep_alive => 1); $ua->credentials('http://********.com/MBSDKService/MsgSDK.asmx?WSDL', +'', '**USERNAME***', '***PASSWORD*****'); my $req = GET $url; print "--Peforming request now...---------\n"; my $res = $ua->request($req); if ($res->is_success) { print $res->content; } else { print "Error: " . $res->status_line . "\n"; print $res->headers()->as_string(), "\n"; } exit 0;
Unfortunately i came only as far as to the reply
# --Peforming request now...--------- # Error: 401 Unauthorized # Date: Thu, 25 Jan 2018 09:59:42 GMT # Server: Microsoft-IIS/7.5 # WWW-Authenticate: Negotiate # WWW-Authenticate: NTLM # Content-Length: 58 # Content-Type: text/html # Client-Date: Thu, 25 Jan 2018 09:59:43 GMT # Client-Peer: ***.*.**.***:** # Client-Response-Num: 1 # Client-Warning: Unsupported authentication scheme 'ntlm' # X-Powered-By: ASP.NET
If it is still unclear what i want: I want to connect to the LandDesk Web Service. (This is the documentation for PowerShell: Documentation) Therefore i need to authenticate and do an Http Post / Get, that i can get a XML file back. Hopefully you understand, what i want. I will be so thankful, if you can help me :) Kind regards Jan

In reply to Authorizing with NTLM by Feneden

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.