luny

Hello IM new .. logging in, and then adding users

18 posts in this topic

#1 ·  Posted (edited)

Hello all, this is what I got so far .. it opens and It won't put in words, I need to log in,,  oops didnt put in code. LOL

 

#include <IE.au3>

Local $oUser, $oPass, $oSubmit
Local $sUser = "lit"
Local $sPass = "abc"
Local $url = "http://woodstock:9090/login.jsp?url=%2Findex.jsp"

 


Local $oIE = _IECreate($url, 1)


_IELoadWait($oIE)

$oInputs = _IETagNameGetCollection($oIE, "input")
for $oInput in $oInputs
    if $oInput.type = "text" And $oInput.name = "userid" And $oInput.size = "12" Then $oUser = $oInput
    if $oInput.type = "password" And $oInput.name = "password" And $oInput.size = "12" Then $oPass = $oInput
    if $oInput.type = "submit" And $oInput.value = "loginformtable" Then $oSubmit = $oInput

    if isObj($oUser) And isObj($oPass) And isObj($oSubmit) then exitloop
Next

$oUser.value = $sUser
$oPass.value = $sPass
_IEAction($oSubmit, "click")

_IELoadWait($oIE)

 

 

1
 

 

 

Edited by luny

Share this post


Link to post
Share on other sites



IT starts a webpage and  CREDENTIALS NEVER POPULATE oops sorry for yelling

Share this post


Link to post
Share on other sites

Try:

#include <IE.au3>

Local $oUser, $oPass, $oSubmit
Local $sUser = "lit"
Local $sPass = "abc"
Local $url = "http://woodstock:9090/login.jsp?url=%2Findex.jsp"
Local $oIE = _IECreate($url, 1)
_IELoadWait($oIE)
$oInputs = _IETagNameGetCollection($oIE, "input")
for $oInput in $oInputs
    If $oInput.name = "userid" Then $oInput.value = $sUser
    If $oInput.name = "password" Then $oInput.value = $sPass
    if $oInput.value = "loginformtable" Then _IEAction($oInput, "click")
Next

 

Share this post


Link to post
Share on other sites

#4 ·  Posted

ill try that,, I see now I didnt have the click high enough

 

Brain fart..

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I put in my actual credentials,, and it did not add them in,,it just opened and sat.. there.. waiting for me.. 

should this be higher on original ??

$oUser.value = $sUser
$oPass.value = $sPass
_IEAction($oSubmit, "click")

 

back to studying I guess, any help would be appreciated.. I am an admin, I add the same person to 20 differnt peoples profile.. so it repetitive.. but I need to log in,, maybe once logged in, I can run auto it after that??  thats a an idea..

 

My plan is to run auto it, I will show a menu,, what am I adding for : PLACE-A  to PLACE_B or C or D or E.  then how many users from a, needed (3) and how many from b (4) i will add info, anf it wil run and add to each of the users from each other.. That is my plan. I have made a couple menus.  so I got that part. but I am trying to run it,, answer questions it loggs in, adds them, and sends email out saying it was done

THAT is the plan.. so I will be here alot. Get used to me. AutoIT WILL be my bitch.. lol

 

Edited by luny

Share this post


Link to post
Share on other sites

#6 ·  Posted

Just re-run with IE open sometimes it goes through the loop too early.

Share this post


Link to post
Share on other sites

#7 ·  Posted

oh ok.. also, in yours, I dont see submit.. $0submit, button used, I believe it is called that, so wouldn't that terminology need to be int here??

Share this post


Link to post
Share on other sites

#8 ·  Posted

No basically it iterates through the inputs and when it finds: loginformtable then it knows that the input is the Submit button it then clicks that Input.

Share this post


Link to post
Share on other sites

#9 ·  Posted

oh ok, I was wondering, am I missing something it opens, and does nOT input anything, it doesn't even say wrong name or password, hmm.. this looks like a job for SEARCH ENGINE>>>lol

Share this post


Link to post
Share on other sites

#10 ·  Posted

SO can anyone give me, help on LOGGING in, and then it INPUTTING username andPASSword for same ??

Share this post


Link to post
Share on other sites

#11 ·  Posted

Can you paste the url source for the complete form?

Share this post


Link to post
Share on other sites

#12 ·  Posted

yes I can, I think that's why it's not working,                I have to learn more what HTML is saying,

 

I was using username and password, to enter my parameters. Thank you again for any help. IM tryin,     I have used 5 different configurations, all of them open browser but credentials do NOT populate.





<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Openfire Admin Console</title>
	<script language="JavaScript" type="text/javascript">
		<!--
		// break out of frames
		if (self.parent.frames.length != 0) {
			self.parent.location=document.location;
		}
        function updateFields(el) {
            if (el.checked) {
                document.loginForm.username.disabled = true;
                document.loginForm.password.disabled = true;
            }
            else {
                document.loginForm.username.disabled = false;
                document.loginForm.password.disabled = false;
                document.loginForm.username.focus();
            }
        }
		//-->
	</script>
    <link rel="stylesheet" href="style/global.css" type="text/css">
    <link rel="stylesheet" href="style/login.css" type="text/css">
</head>

<body>

<form action="login.jsp" name="loginForm" method="post">



    <input type="hidden" name="url" value="/index.jsp">



<input type="hidden" name="login" value="true">

<div align="center">
    <!-- BEGIN login box -->
    <div id="jive-loginBox">
        
        <div align="center" id="jive-loginTable">

            <span id="jive-login-header" style="background: transparent url(images/login_logo.gif) no-repeat left; padding: 29px 0 10px 205px;">
            Administration Console
            </span>

            <div style="text-align: center; width: 380px;">
            <table cellpadding="0" cellspacing="0" border="0" align="center">
                <tr>
                    <td align="right" class="loginFormTable">

                        <table cellpadding="2" cellspacing="0" border="0">
                        <noscript>
                            <tr>
                                <td colspan="3">
                                    <table cellpadding="0" cellspacing="0" border="0">
                                    <tr valign="top">
                                        <td><img src="images/error-16x16.gif" width="16" height="16" border="0" alt="" vspace="2"></td>
                                        <td><div class="jive-error-text" style="padding-left:5px; color:#cc0000;">Error: You don't have JavaScript enabled. This tool uses JavaScript and much of it will not work correctly without it enabled. Please turn JavaScript back on and reload this page.</div></td>
                                    </tr>
                                    </table>
                                </td>
                            </tr>
                        </noscript>
                        
                        <tr>
                            <td><input type="text" name="username" size="15" maxlength="50" id="u01" value=""></td>
                            <td><input type="password" name="password" size="15" maxlength="50" id="p01"></td>
                            <td align="center"><input type="submit" value="&nbsp; Login &nbsp;"></td>
                        </tr>
                        <tr valign="top">
                            <td class="jive-login-label"><label for="u01">username</label></td>
                            <td class="jive-login-label"><label for="p01">password</label></td>
                            <td>&nbsp;</td>
                        </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <div align="right" id="jive-loginVersion">
                        Openfire, Version: 3.7.1
                        </div>
                    </td>
                </tr>
            </table>
            </div>
        </div>

    </div>
    <!-- END login box -->
</div>

</form>

<script language="JavaScript" type="text/javascript">
<!--
    if (document.loginForm.username.value == '')  {
	    document.loginForm.username.focus();
    } else {
        document.loginForm.password.focus();
    }
//-->
</script>

</body>
</html>

 

Share this post


Link to post
Share on other sites

#13 ·  Posted

This works fine for me:

#include <IE.au3>

Local $sUsername = 'lit'
Local $sPassword = 'abc'
Local $oIE = _IECreate("http://woodstock:9090/login.jsp?url=%2Findex.jsp", 1)
Local $oInputs = _IETagNameGetCollection($oIE, "Input")
For $oInput In $oInputs
    If $oInput.name = 'username' Then $oInput.value = $sUsername
    If $oInput.name = 'password' Then $oInput.value = $sPassword
    If $oInput.type = 'submit' Then _IEAction($oInput, "Click")
Next

You can also use:

#include <IE.au3>

Local $sUsername = 'lit'
Local $sPassword = 'abc'
Local $oIE = _IECreate("http://woodstock:9090/login.jsp?url=%2Findex.jsp", 1)
Local $oForm = _IEFormGetObjByName($oIE, "loginform")
Local $oUsername = _IEFormElementGetObjByName($oForm, "username")
    _IEFormElementSetValue($oUsername, $sUsername)
Local $oPassword = _IEFormElementGetObjByName($oForm, "password")
    _IEFormElementSetValue($oPassword, $sPassword)
_IEFormSubmit($oForm)

 

Share this post


Link to post
Share on other sites

#14 ·  Posted

I used both, it opens, but no credentials, populate..it doesn't even say login error,  I guess I can log ing, and then run, a script to add users, I'll try that. I'll leave this up, so if I can figure this out, maybe I can help someone else.. I mean we are a team after all. Thank you very much for the help

 

 

 

Share this post


Link to post
Share on other sites

#15 ·  Posted

You could try adding #RequireAdmin to the top and compiling the script first, but on my system I just copied your file above into a local file, ran both scripts above and it completed the form and submitted so I'm guessing its something environmental rather than code based.

Share this post


Link to post
Share on other sites

#16 ·  Posted

hmmmm

Share this post


Link to post
Share on other sites

#17 ·  Posted

Actually ignore my last post, remove #RequireAdmin and then run the script from within Scite and let us know what errors show in the console.  You may need to put a Sleep(3000) to sleep 3 seconds or it might need to be longer after _IECreate function.  I'm going to be away from my system for the next couple of hours so won't be able to respond until then.

Share this post


Link to post
Share on other sites

#18 ·  Posted

thank you ill try that

i thought it might need a sleep as I put on on from my ,, learning

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • luny
      By luny
      I want to open http://woodstock:9090/login.jsp?url=%2Findex.jsp and then it hsould enter my credentials, and then enter users, and minpulate users inside it. I have tried over 10 different ways,, it opens the page and does NOT enter data.. thisis the code from back of page, IM obviously missing somehting, <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Openfire Admin Console</title> <script language="JavaScript" type="text/javascript"> <!-- // break out of frames if (self.parent.frames.length != 0) { self.parent.location=document.location; } function updateFields(el) { if (el.checked) { document.loginForm.username.disabled = true; document.loginForm.password.disabled = true; } else { document.loginForm.username.disabled = false; document.loginForm.password.disabled = false; document.loginForm.username.focus(); } } //--> </script> <link rel="stylesheet" href="style/global.css" type="text/css"> <link rel="stylesheet" href="style/login.css" type="text/css"> </head> <body> <form action="login.jsp" name="loginForm" method="post"> <input type="hidden" name="url" value="/index.jsp"> <input type="hidden" name="login" value="true"> <div align="center"> <!-- BEGIN login box --> <div id="jive-loginBox"> <div align="center" id="jive-loginTable"> <span id="jive-login-header" style="background: transparent url(images/login_logo.gif) no-repeat left; padding: 29px 0 10px 205px;"> Administration Console </span> <div style="text-align: center; width: 380px;"> <table cellpadding="0" cellspacing="0" border="0" align="center"> <tr> <td align="right" class="loginFormTable"> <table cellpadding="2" cellspacing="0" border="0"> <noscript> <tr> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td><img src="images/error-16x16.gif" width="16" height="16" border="0" alt="" vspace="2"></td> <td><div class="jive-error-text" style="padding-left:5px; color:#cc0000;">Error: You don't have JavaScript enabled. This tool uses JavaScript and much of it will not work correctly without it enabled. Please turn JavaScript back on and reload this page.</div></td> </tr> </table> </td> </tr> </noscript> <tr> <td><input type="text" name="username" size="15" maxlength="50" id="u01" value=""></td> <td><input type="password" name="password" size="15" maxlength="50" id="p01"></td> <td align="center"><input type="submit" value="&nbsp; Login &nbsp;"></td> </tr> <tr valign="top"> <td class="jive-login-label"><label for="u01">username</label></td> <td class="jive-login-label"><label for="p01">password</label></td> <td>&nbsp;</td> </tr> </table> </td> </tr> <tr> <td align="right"> <div align="right" id="jive-loginVersion"> Openfire, Version: 3.7.1 </div> </td> </tr> </table> </div> </div> </div> <!-- END login box --> </div> </form> <script language="JavaScript" type="text/javascript"> <!-- if (document.loginForm.username.value == '') { document.loginForm.username.focus(); } else { document.loginForm.password.focus(); } //--> </script> </body> </html
    • 31290
      By 31290
      Hello everyone, 
      I'm working on a WMIC uninstaller. A quite simple one with a button to display product names in a editable list (for copy/paste purposes) but the main problem is that in order to achieve this, in my corporation, normal users cannot uninstall softs.
      What I found/adapt so far:
      #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("wmic uninstaller", 300, 152, 337, 380) $Label1 = GUICtrlCreateLabel("Computername", 0, 8, 75, 17) $Input1 = GUICtrlCreateInput(@ComputerName, 0, 32, 125, 21) $Label2 = GUICtrlCreateLabel("wmic command", 150, 8, 77, 17) $Combo1 = GUICtrlCreateCombo("Model_Computer", 150, 32, 125, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Current_user|Installed_Apps|Serial_Number|Bios_Version") $Button1 = GUICtrlCreateButton("List Apps", 150, 72, 91, 49) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $button1 $wmi = GUICtrlRead($combo1) $pc = GUICtrlRead($input1) call($wmi,$pc) EndSwitch WEnd Func Model_Computer($pc) RunWait(@ComSpec & ' /c ' & 'wmic /node:' & $pc &' product get name > %temp%\apps.txt' ,"", @SW_HIDE) $file=(@TempDir & "/apps.txt") $fileread= FileRead($file) MsgBox(0, $pc , $fileread) FileDelete(@TempDir & "/apps.txt") EndFunc Here's the textual version I gave to my techs:
      Create cmd shortcut on Desktop, run it as a different user (using their own admin accounts). Once opened, type wmic Once wmic loaded, type product get name Wait for the list of installed soft to display Type product where name="Exact App name" call uninstall Type "Y" to confirm Wait for task execution Don't care about exit code App is uninstalled (verified by getting the list again)! In fact, I'd like to automatize this process.
      Any ideas over here?
      Thanks ^^
    • remin
      By remin
      I created a script and I'm ready to launch it at windows start-up and want to do it as Admin in order to use the script also when a window has UAC enabled.
      But...
      - When I right click on the file there is No option "Run as Administrator" 
      - I tried to add the file to task scheduler with elevated rights, but when I run the task it edits the file (in SciTE4)
      - When I push down the CTRL & SHIFT key and click the script file, the same thing happens as running the task in task scheduler.
      I'm the admin of the pc and I can run non autoit programs/scripts on above ways.
      I tried to reinstall the autoit setup exe file running as administrator but it didn't resolve the problem.
      What did I wrong?
      How can I run the script with elevated rights in task scheduler?
      ps: I'm running win8 64 bits, but installed autoit in 32bits mode.
    • borism25
      By borism25
      Hi!

      I have a question...i need to run "this" on the 500 PC, on every PC is the same user and pass for admin.

      Team viewer Host proces can't be killed if i am not admin.

      So the question is how to run the CMD with admin Rights. (example: User:Admin | Pass: 0000)

      I try the command runas but nothing happens.


      i will be very gratefull if someone can type just example script. Thnx in advanced.
    • LiquidNitrogen
      By LiquidNitrogen
      This is Something i Made to block Applications from Being Used without Using the Windows UAC and Stuff. Its Quicker and it Works. Let me know what You Think.

      You Need the config.ini file in the Folder with the Script.

      Admin System.rar