Windows Vista Forums

Login to a forum
  1. #1


    pjo Guest

    Login to a forum


    Hi!
    I am trying to login to a free, public, registration-required forum but
    I got some problem.

    function Login-Forex{
    param(
    [string]$uname,
    [string]$url="http://www.testsitecom/",
    [bool]$cookie=$FALSE
    )

    $creds = get-credential $uname
    $pass = $creds.GetNetworkCredential().Password
    $user = $creds.GetNetworkCredential().username
    $ie=new-object -com internetexplorer.application
    $ie.visible=$FALSE
    $ie.navigate($url)
    # while($ie.ReadyState -ne 4) {start-sleep -Milliseconds 1}
    Start-Sleep -Seconds 5

    $ie.document.getElementById("navbar_username").value = $user
    $ie.document.getElementById("navbar_password").value = $pass
    # $ie.document.getElementsByName("PersistentCookie") | foreach
    {$_.checked=$cookie}
    $forms = @($ie.Document.forms | where {$_.action -match "do=login"})
    Start-Sleep -Seconds 5
    # $ie.document.getElementById("Log In").submit()
    $forms[0].submit()
    }

    Login-Forex xxxx



    For some reason, navbar_username and navbar_password gets null.
    So if these are null, $user and $pass should be submitted.
    Please advise how to write it.

    Thanks in advance.

    pjo:surrender


    --
    pjo
    http://www.techtalkz.com - Technology and Computer Troubleshooting Forums


      My System SpecsSystem Spec

  2. #2


    Shay Levi Guest

    Re: Login to a forum

    Hi

    No one can test your code since the URL is bogus.
    Can you test the code manually, wait for the page to finish loading
    and then invoking the navbar_username and navbar_password lines?

    BTW, '$user = $creds.GetNetworkCredential().username' is unnecessary since
    you already have it ($uname parameter).

    -----
    Shay Levi
    $cript Fanatic
    http://scriptolog.blogspot.com

    > Hi!
    > I am trying to login to a free, public, registration-required forum
    > but
    > I got some problem.
    > function Login-Forex{
    > param(
    > [string]$uname,
    > [string]$url="http://www.testsitecom/",
    > [bool]$cookie=$FALSE
    > )
    > $creds = get-credential $uname
    > $pass = $creds.GetNetworkCredential().Password
    > $user = $creds.GetNetworkCredential().username
    > $ie=new-object -com internetexplorer.application
    > $ie.visible=$FALSE
    > $ie.navigate($url)
    > # while($ie.ReadyState -ne 4) {start-sleep -Milliseconds 1}
    > Start-Sleep -Seconds 5
    > $ie.document.getElementById("navbar_username").value = $user
    > $ie.document.getElementById("navbar_password").value = $pass
    > # $ie.document.getElementsByName("PersistentCookie") | foreach
    > {$_.checked=$cookie}
    > $forms = @($ie.Document.forms | where {$_.action -match "do=login"})
    > Start-Sleep -Seconds 5
    > # $ie.document.getElementById("Log In").submit()
    > $forms[0].submit()
    > }
    > Login-Forex xxxx
    >
    > For some reason, navbar_username and navbar_password gets null. So if
    > these are null, $user and $pass should be submitted. Please advise how
    > to write it.
    >
    > Thanks in advance.
    >
    > pjo:surrender
    >


      My System SpecsSystem Spec

  3. #3


    Marco Shaw [MVP] Guest

    Re: Login to a forum


    >> $ie.visible=$FALSE
    Also, just for fun, try this when setting this to $TRUE.

    Marco

      My System SpecsSystem Spec

  4. #4


    pjo Guest

    Re: Login to a forum


    Thanks SHay,

    Yes I tested it manually.
    It does not work any more.

    This guy said this is Vista/IE7 limitation.
    http://www.systemscript.com/forumps1...sts.asp?TID=17
    http://www.systemscript.com/forumps1...sts.asp?TID=16

    Are we in a big trouble using PowerShell on Vista ?

    pjo


    --
    pjo
    http://www.techtalkz.com - Technology and Computer Troubleshooting Forums


      My System SpecsSystem Spec

  5. #5


    Oisin (x0n) Grehan [MVP] Guest

    Re: Login to a forum

    On Feb 12, 9:50*am, Shay Levi <n...@xxxxxx> wrote:

    >
    > No one can test your code since the URL is bogus.
    And as an aside to the main topic, there is actually a reachable url
    reserved (RFC2606) for exactly this kind of thing:

    http://www.example.com/

    for more information, see http://www.rfc-editor.org/rfc/rfc2606.txt

    - Oisin




      My System SpecsSystem Spec

  6. #6


    Shay Levi Guest

    Re: Login to a forum

    Interesting... thanks.



    -----
    Shay Levi
    $cript Fanatic
    http://scriptolog.blogspot.com

    > On Feb 12, 9:50 am, Shay Levi <n...@xxxxxx> wrote:
    >

    >> No one can test your code since the URL is bogus.
    >>
    > And as an aside to the main topic, there is actually a reachable url
    > reserved (RFC2606) for exactly this kind of thing:
    >
    > http://www.example.com/
    >
    > for more information, see http://www.rfc-editor.org/rfc/rfc2606.txt
    >
    > - Oisin
    >


      My System SpecsSystem Spec

  7. #7


    Shay Levi Guest

    Re: Login to a forum

    What happend? It already worked. Can you check if the following works?

    http://scriptolog.blogspot.com/2007/...web-forms.html



    -----
    Shay Levi
    $cript Fanatic
    http://scriptolog.blogspot.com

    > Thanks SHay,
    >
    > Yes I tested it manually.
    > It does not work any more.
    > This guy said this is Vista/IE7 limitation.
    > http://www.systemscript.com/forumps1...sts.asp?TID=17
    > http://www.systemscript.com/forumps1...sts.asp?TID=16
    >
    > Are we in a big trouble using PowerShell on Vista ?
    >
    > pjo
    >


      My System SpecsSystem Spec

  8. #8


    pjo Guest

    Re: Login to a forum


    Oisin Thanks for your comment.

    But I do not know how to use http://www.example.com/
    Could you explain in detail ?

    pjo


    --
    pjo
    http://www.techtalkz.com - Technology and Computer Troubleshooting Forums


      My System SpecsSystem Spec

  9. #9


    pjo Guest

    Re: Login to a forum


    Hi Shay,

    This Gmail login does not work in Vista here.
    It looks like the same problem regarding PS/IE7 focus.

    pjo

    -----------

    Shay Levi;1706487 Wrote:

    > What happend? It already worked. Can you check if the following works?
    >
    > http://scriptolog.blogspot.com/2007/...web-forms.html
    >
    >
    >
    > -----
    > Shay Levi
    > $cript Fanatic
    > http://scriptolog.blogspot.com
    >

    > > Thanks SHay,
    > >
    > > Yes I tested it manually.
    > > It does not work any more.
    > > This guy said this is Vista/IE7 limitation.
    > > http://www.systemscript.com/forumps1...sts.asp?TID=17
    > > http://www.systemscript.com/forumps1...sts.asp?TID=16
    > >
    > > Are we in a big trouble using PowerShell on Vista ?
    > >
    > > pjo
    > >

    --
    pjo
    http://www.techtalkz.com - Technology and Computer Troubleshooting Forums


      My System SpecsSystem Spec

  10. #10


    pjo Guest

    Re: Login to a forum


    Hi!
    The Admin at http://www.systemscript.com/forumps1us/default.asp
    found out that on Vista PowerShell must be run as an admin !!!!
    This solved all the problem !

    pjo:wdone:


    --
    pjo
    http://www.techtalkz.com - Technology and Computer Troubleshooting Forums


      My System SpecsSystem Spec

Login to a forum problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
most effective way via javascript login scripts to allow login rightsto all our servers to our Network Team group skylyn VB Script 4 12 Jun 2009
login error, screensaver can't run on login screen, Direct X 9.0 not recognized MrElectrifyer Graphic cards 11 23 May 2009
Login Completely Blocked w/User Profile Service Failed the Login THNKIT Vista account administration 10 15 Jul 2008
Urgent - Windows Mail keeps asking for confirmation of login and will not receive (login is correct) Gavacho Vista mail 1 14 Dec 2007
No login on this forum and other problems after Vista update Tony Vista General 0 03 Dec 2007