Unable to submit form on web page using Invoke-WebRequest

Looking to automate the Web search on HP's website by serial number to get the warranty data.  I am able to successfully get back the web page, and I can populate the fields in the form. However, when I submit the POST, I don't seem to get back any
data.
Please look at the below script and tell me what I'm doing wrong. I am following the FACEBOOK "Example 2" from the Get-Help in PowerShell 3.0.
$Serial = "CND1076GST"
$Url = "http://h20566.www2.hp.com/portal/site/hpsc/public/wc/home/"
$r = Invoke-WebRequest -Uri $Url -SessionVariable HP
If ($r.StatusDescription -eq "OK" ) {
Write-Host $r.StatusDescription
$HP
$form = $r.Forms.Item("wcFormDataItem")
$form.Fields["serialNumber0"] = $Serial
$r2 = Invoke-WebRequest -Uri ($Url + $form.Action) -WebSession $HP -Method POST -Body $form.Fields
$r2.Content | Out-File c:\temp\test.htm -Force
Write-Host $r2.StatusDescription
} Else {
Write-Host $r.StatusDescription
Levi Stevens | Technical Consultant Dell Services

This is how easy it is to lookup the same data from Dell.
$GUID = "cac8daa8-6699-466b-a3d3-f07e571fba1f"
$AppName = "Dell Warranty"
$ServiceTag = "5LCQSY1"
$WebProxy=New-WebServiceProxy -Uri http://xserv.dell.com/services/assetservice.asmx
$WarrantyInformation=$WebProxy.GetAssetInformation($GUID,"Dell Warranty",$ServiceTag)
$WarrantyInformation | Select-Object -ExpandProperty Entitlements
Levi Stevens | Technical Consultant Dell Services

Similar Messages

  • Enter into web page recursively using invoke-webrequest

    This is how I authorize to web page using Invoke-WebRequest command right now:
    $web = Invoke-WebRequest https://mypage/ -SessionVariable gos
    $forms = $web.Forms[0]
    $forms.Fields["username"] = "[email protected]"
    $forms.Fields["password"] = "pass"
    $web_invoke = Invoke-WebRequest -Uri ("https://mypage" + $forms.Action) -WebSession $matt -Method Post -Body 
    $web_invoke.StatusDescription
    Thing is that I have to login once again when I logged into first webpage to reach another service.
    I have traced logid_ID and passsword_ID as well as button that will transfer me to the needed page.
    How can I combine these two logins in one script?

    Hi Kirillpashkov,
    If you want to sign in web service, the example below is for your reference, which could sign in to the Facebook web service:
    # Sends a sign-in request by running the Invoke-WebRequest cmdlet. The command specifies a value of "fb" for the SessionVariable parameter, and saves the results in the $r variable.
    $r=Invoke-WebRequest http://www.facebook.com/login.php -SessionVariable fb
    # Use the session variable that you created in Example 1. Output displays values for Headers, Cookies, Credentials, etc.
    $fb
    # Gets the first form in the Forms property of the HTTP response object in the $r variable, and saves it in the $form variable.
    $form = $r.Forms[0]
    # Pipes the form properties that are stored in the $forms variable into the Format-List cmdlet, to display those properties in a list.
    $form | Format-List
    # Displays the keys and values in the hash table (dictionary) object in the Fields property of the form.
    $form.fields
    # The next two commands populate the values of the "email" and "pass" keys of the hash table in the Fields property of the form. Of course, you can replace the email and password with values that you want to use.
    $form.Fields["email"] = "[email protected]"
    $form.Fields["pass"] = "P@ssw0rd"
    # The final command uses the Invoke-WebRequest cmdlet to sign in to the Facebook web service.
    $r=Invoke-WebRequest -Uri ("https://www.facebook.com" + $form.Action) -WebSession $fb -Method POST -Body $form.Fields
    Refer to:
    accept a cookie while using Invoke-WebRequest
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang

  • Users unable to submit form

    I am having a problem with some of my users unable to submit forms. They can see the submit button but when they click on it nothing happens. I do not receive the data into my database and they do not recieve my automatic confirmation that they should get upon submission. Others have no problem. I've tested the link and seems to work fine for me in both IE and Firefox.

    I am helping Shannon out with this one.  I'm sorry to hear you are having problems.
    I have tested your form, but everything looks fine from this end.
    Can you provide some information about the users who are experiencing the problem?  What operating system are they using? Windows 7? Windows XP? Mac?  What browser and version are they using?
    At the top of the form, does the user see the message 'Javascript is not enabled in your browser.'?
    Try closing all instances of the browser, open the browser, clear the browser cache, and reload the form.
    Try another browser.
    Can you provide a screenshot of the form when the user experiences the problem?
    Thanks,
    -DevRandy

  • Submit form to same page?

    how to submit form to same page.
    <%@ page contentType="text/html; charset=iso-8859-1" language="java"
         import="java.sql.*" errorPage=""%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <script>
    function sample()
         document.form_Configure.submit();
    </script>
    </head>
    <body bgcolor="#FFFDF3">
    <FORM name="form_Configure">
    <center>
              <p align="center"><br />
              <% String[] serverNames={"Server1", "Server2", "Server3"};%>
              DataBase Type     : <select name="DatabaseTypes"
                   ONCHANGE="sample()" style=" width:211; height:211">
                   <% for(int i = 0; i < serverNames.length; i++)
                    %>
                   <option><%=serverNames%></option>
                   <% }     %>
              </select>
    </center>
    </FORM>
    </body>
    </html>
    cheers
    rasmi

    Put the name of the page in the action attribute of the form, just like you always would :s
    Or perhaps you mean that you want to submit to a different frame or something? In that case you use the target attribute and give it the name of the frame you want to submit to.

  • How to redirect from list edit form to another page using jquery in sharepoint 2013

    hi friends i have been trying to find a way to redirect from list edit form to another page using javascript and jquery
    i found lot of codes online but non of them are working for me.
    what i need is i have to save the data in the form and after that it has to redirect to another page. it has to get the url from hyperlink field of the item.
    please help me in this regards

    Not sure if you have gone through below links:
    http://spservices.codeplex.com/wikipage?title=%24().SPServices.SPRedirectWithID
    http://blogs.askcts.com/2013/02/18/using-spservices-and-jquery-to-perform-a-redirect-from-a-sharepoint-list-newform-to-editform/
    Please ensure that you mark a question as Answered once you receive a satisfactory response.

  • How to show modal window without popup in a web page using javascript

    Hi,
    How to show modal window without popup in a web page using javascript, means when the modalwindow is opened it should not ask for popup blocker alert......
    pls help me.....

    Thanx for ur reply,
    Actually the senario is when i click on a button, another jsp page should be displayed in a modal window without popup, but the functions alert() and confirm() will not accept the url path of the another jsp page...

  • Silent print a PDF from a web page using Flex. We are targeting Windows and Mac with Arcobat reader installed

    We are planning to Silent print a PDF from a web page using Flex. We are targeting Windows and Mac with Arcobat reader installed. I have tried using the AIR appliaction and it worked, But our requirement is NO INSTALL to the user machine for the silent printing. It is just from web page and silent printing to the default printer to the desktop/Laptop. Can anyone share your thoughts and experience with us. It will be very helpful..
    For AIR : I tried the thread Re: AIR and PDF showing/silent printing

    Hey CodeMonkey & Ross,
    Did you either of you ever find a solution? I'm stuck too, it seems I can get remote printing on all these PDFs to work but it just prints a blank page since I've been using Javascript in the browser, not Adobe's (they are Engineering drawings that I do not have permission to edit so I can't just insert code into them but I need to make work instructions). I've been scouring the internet for hours now, it seems that this thread is the only relevant/useful one at this point. No one else was trying to achieve this for similar reasons to mine.
    Thanks guys,
    Lox

  • Need help to access a web page using midlet to retrieve some informations

    Hi everyone i'm trying to access a web page using midlet to retrieve some informations in text format, the web page is [http://daviddurand.info/D228/?villes|http://daviddurand.info/D228/?villes] for my project.
    the problem is that i always get error 10049 in socket::open meaning no adresse could be found i tried IP adresse and still the same.
    i managed to recreate the same web page to test it on local and the surprise that it works fine but when accessing it online i have this error.
    i tried also to get the page i created on a webserver i own to try it saying that there might be security issues but the same error appears again. so help plz
    here is my code :
    package mobileapplication5;
    import java.io.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class GetMidlet extends MIDlet {
    private Display display;
    String url = "http://dayaati.com/villes/index.php?villes";
    public GetMidlet() {
    display = Display.getDisplay(this);
    public void startApp() {
    try {
    getBirthdayFromNameUsingGet(url);
    } catch (IOException e) {
    System.out.println("IOException " + e);
    e.printStackTrace();
    public void pauseApp() {   }
    public void destroyApp(boolean unconditional) {  }
    public void getBirthdayFromNameUsingGet(String url) throws IOException {
              HttpConnection httpConn = null;
              InputStream is = null;
              OutputStream os = null;
              try {
    httpConn = (HttpConnection)Connector.open(url);
    httpConn.setRequestProperty("User-Agent", "Profile/MIDP-2.1 Configuration/CLDC-1.1");
    httpConn.setRequestProperty("Content-Language", "en-US" );
    httpConn.setRequestProperty("Content-Type", "text/html; charset=iso-8859-1");
    httpConn.setRequestProperty( "Connection", "keep-alive" );
    httpConn.setRequestProperty("Content-Length","51200");
              getConnectionInformation(httpConn);
              int respCode = httpConn.getResponseCode();
              if (respCode == httpConn.HTTP_OK) {
                   StringBuffer sb = new StringBuffer();
                   os = httpConn.openOutputStream();
                   is = httpConn.openDataInputStream();
                   int chr;
                   while ((chr = is.read()) != -1)
                   sb.append((char) chr);
                   // Web Server just returns the birthday in mm/dd/yy format.
                   System.out.println(sb.toString());
              else {
                   System.out.println("Error in opening HTTP Connection. Error#" + respCode);
              } finally {
                   if(is!= null)
                   is.close();
                   if(os != null)
                        os.close();
              if(httpConn != null)
                        httpConn.close();
    void getConnectionInformation(HttpConnection hc) {
    System.out.println("Request Method for this connection is " + hc.getRequestMethod());
    System.out.println("URL in this connection is " + hc.getURL());
    System.out.println("Protocol for this connection is " + hc.getProtocol());
    System.out.println("This object is connected to " + hc.getHost() + " host");
    System.out.println("HTTP Port in use is " + hc.getPort());
    System.out.println("Query parameter in this request are " + hc.getQuery());
    **Heeeeeeelp Please**

    [http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/crashes.html]
    SIGSEGV (0xb)Most common cause of that is JNI code used directly or indirectly through a 3rd party library.
    64-Bit Server VM (11.2-b01 mixed mode linux-amd64)Conversely that VM gets less traffic than others so you might have hit a bug in it.

  • How can I add a podcast episode to an existing web page using iWeb?

    How can I add an episode to an existing web page using iWeb?
    I could probably figure this out but I am afraid if I make changes to the site and re-upload it to the podcast area I will have just doubled it. I see them repeated from time to time.
    What is the proper protocal? Thanks
    Mac G4   Mac OS X (10.4.3)  

    Hi apple-owner,
    Method 1.
    To create this scatter-plot, I selected the whole of Columns A and B. (Shift click on the Column reference tabs).
    The plot ignores blank rows, but they are "ready" for new data:
    Method 2
    If you did not select whole columns, you can extend the "active" rows. Rows 1-5 selected:
    Add more data rows and drag the fill handle (small white circle, bottom right) down
    Regards,
    Ian.

  • IPhoto still won't make web pages using the comments field

    I am someone who makes use of the comments field in iPhoto. I don't edit the title, because I thought it edited the photo file name (perhaps only in earlier iPhoto versions). Unfortunately, the Apple's tools for making a web page from iPhoto '08 seem to still use the title field only and not the comment field. That means that I have to edit all titles (to blank or a proper title) if I just want to show an annotation on just a few photos in a web page. At least the comments field defaults to blank, so I normally use it, along with the Better HTML plugin to make web pages, http://www.geeksrus.com/software/betterhtmlexport/
    Now, the web pages produced by Apple are now as good as and even better than the BHTML templates, and I'd like to use them. But this problem with the comments means I can't quickly convert my old photo albums to something that makes nice web pages using my annotations with the iPhoto tools.
    Does anybody know of any solutions to this problem? E.g. a script to copy the comments field to the title field?

    I know what you mean. I can't believe that after so many versions of iPhoto that have supported publishing of some sort that such a basic and obvious feature still hasn't been implemented. It can't take that much effort to add. I'd rather have that than the new (and IMHO completely useless) "Events" feature. Speaking of which, does anyone know if there is a way to turn it off? It's annoying the heck outta me. I hate it.

  • Create WEB PAGE using PL/SQL

    Does anyone have explicit example of how to generate web page by invoking a PL/SQL stored procedure from Windows desktop?

    here's a starting point for documentation
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_web.htm
    you'll need to install an http service (if using 10g, just install the companion cd), and set up a DAD for MOD_PLSQL
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14190/confmods.htm#sthref550
    good luck

  • Cannot Link PDF form to web page

    Have form Centeral and Create PDF and cannot get eighter to link form to web page?

    Sorry I don't understand. Can you provide details on the problem you are having.
    Randy

  • How to embed 3D models in web page using JAVA?

    Hello
    I'm doing a project at University to create a virtual tour of a village. I am creating the buildings in MAYA using polygon planes and cubes and then exporting to VRML.
    I plan to embed each individual model into a separate web page. Then when the user clicks on a location in a 2D map they will be taken to the web page containing that building.
    However, I can't work out how to embed these 3D models into web pages using JAVA. Can anyone help me with this, please?
    Also, I've been told to use JAVA 3D to interact with the project but am unclear as to how JAVA 3D would be used in this project - aqny ideas/suggestions welcome!
    M.

    If you use Java-plugin, you can embed Java3D in a web page.
    Here is the URL(http://www.geovista.psu.edu/products/demos/LorenzAttractor3D/index.html) which used Java3D.
    I hope this helps.
    Masa

  • Resizing pixs for web page use

    I have resized the photos to use on MS Frontpage but when the thumbnails are clicked on to be enlarged in the web page they are still too large. How do I make photos usable for web page use?

    What version of Elements are you using? How are you now going about creating the thumbnails and larger images? What size are you making the large ones? I suspect all you need to do is change the width and height parameters to something smaller.

  • Generating Web Pages using PL/Sql

    Friends,
    Would eb gr8 if you can provide me with some help files to learn about developing Web pages using Oracle 8i Procedures.
    Would really appreaciate your help
    null

    Ex:
    CREATE or REPLACE PROCEDURE hello
    IS
    BEGIN
    htp.p('<html>');
    htp.p('<head>');
    htp.p('<title>Hello World Test</title>');
    htp.p('</head>');
    htp.p('<body>');
    htp.p('<h1>Hello World Biju</h1>');
    htp.p('<p>The time is '
    &#0124; &#0124;to_char(sysdate, 'hh24:mi:ss yyyy-mm-dd')
    &#0124; &#0124;'</p>'
    htp.p('</body>');
    htp.p('</html>');
    end hello;
    You can call the above stored procedure by using the following URL: http://machinename:portno/pls/sid/hello
    Jack
    null

Maybe you are looking for

  • How to populate the table using webservice

    Hi, i have created the web service from function module and  integrated this web service in interactive form using New data connection. I have drag and drop all field into the form table and test the form,but its not populate table. if any script nee

  • [Solved] Eye of Gnome awful (broken?) interface after upgrade

    Just today I've upgraded from eog 3.14.3 to eog 3.16.1 and am incredibly disappointed in the new interface I'm seeing, to the point where I expect something isn't working as it should.  (I've downgraded to 3.14 as a temporary solution). Normally (3.1

  • Access database/ java application/ jdbc odbc

    i am building an access database with a java application and get the following error message when i try to run the application. the log in window that i have does not have a password text field, only a field for the odbc name. java.sql.SQLException:

  • Reuse image file from another DC

    Hi everyone, Is it possible to re-use image file stored in the mimes folder of a component in a DC from another DC ?  If it is possible, how do we access the image? Thanks, Johannes

  • PDF link receives error message

    Hi, I'm using Adobe CS5 and am working on a webpage for my university's website. I have been linking PDFs of brochures onto the website. Today, I changed the brochure, changed the name of the brochure, deleted the old brochure link, and re-linked the