Jump to content

mknope

Active Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by mknope

  1. I am still not getting anything. _Cred_Get("test", 1) Func _Cred_Get($sTarget, $iType = 1) ;Type: 2=Domain, 1=Local. CAN'T RETURN DOMAIN PASSWORDS!!! Local $FuncRet[3] Local $structTarget = DllStructCreate("wchar[100]") DllStructSetData($structTarget,1,$sTarget) Local $hAdvapi32 = DllOpen("Advapi32.dll") If $hAdvapi32 = -1 Then Msgbox(0, "Error", "Failed to connect to the Credentials Store") Exit Endif Local $Ret = DllCall($hAdvapi32, 'bool', 'CredReadW', 'ptr', DllStructGetPtr($structTarget), 'dword', $iType, 'dword', 0, 'ptr*', 0) if $ret[0]=0 then Return SetError(1,0,$FuncRet) Local $structCREDENTIAL= "" & _ "DWORD Flags;" & _ "DWORD Type;" & _ "Ptr TargetName;" & _ "Ptr Comment;" & _ "UINT64 LastWritten;" & _ "DWORD CredintialBlobSize;" & _ "Ptr CredentialBlob;" & _ "DWORD Persist;" & _ "DWORD AttributeCount;" & _ "Ptr Attributes;" & _ "Ptr TargetAlias;" & _ "Ptr Username" Local $tdata=DllStructCreate($structCREDENTIAL, $Ret[4]) Local $userName = DllStructCreate("wchar[513]", DllStructGetData($tdata, 'Username')) Local $User = DllStructGetData($userName, 1) Local $CredentialBlobSize = DllStructGetData($tdata, 'CredintialBlobSize') Local $credentialBlob = DllStructCreate("wchar[512]", DllStructGetData($tdata, 'CredentialBlob')) Local $Password = StringLeft(DllStructGetData($credentialBlob, 1), $CredentialBlobSize/2) Local $Comment = DllStructCreate("wchar[256]", DllStructGetData($tdata, 'Comment')) Local $Comm = DllStructGetData($Comment, 1) Dim $FuncRet[] = [$User, $Password, $Comm] Return $FuncRet $retarray = _Cred_Get("test", 1) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Error code: ' & @error & @CRLF) ;### Debug Console ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $retarray[0] = ' & $retarray[0] & @CRLF) ;### Debug Console ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $retarray[1] = ' & $retarray[1] & @CRLF) ;### Debug Console ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $retarray[2] = ' & $retarray[2] & @CRLF) ;### Debug Console EndFunc ;_Cred_Get
  2. ;================================================================================================ ;===== Retrieve the Credentials for the specified item ========================================= ;================================================================================================ _Cred_Get("test", 1) Func _Cred_Get($sTarget, $iType = 1) ;Type: 2=Domain, 1=Local. CAN'T RETURN DOMAIN PASSWORDS!!! Local $FuncRet[3] Local $structTarget = DllStructCreate("wchar[100]") DllStructSetData($structTarget,1,$sTarget) Local $hAdvapi32 = DllOpen("Advapi32.dll") If $hAdvapi32 = -1 Then Msgbox(0, "Error", "Failed to connect to the Credentials Store") Exit Endif Local $Ret = DllCall($hAdvapi32, 'bool', 'CredReadW', 'ptr', DllStructGetPtr($structTarget), 'dword', $iType, 'dword', 0, 'ptr*', 0) if $ret[0]=0 then Return SetError(1,0,$FuncRet) Local $structCREDENTIAL= "" & _ "DWORD Flags;" & _ "DWORD Type;" & _ "Ptr TargetName;" & _ "Ptr Comment;" & _ "UINT64 LastWritten;" & _ "DWORD CredintialBlobSize;" & _ "Ptr CredentialBlob;" & _ "DWORD Persist;" & _ "DWORD AttributeCount;" & _ "Ptr Attributes;" & _ "Ptr TargetAlias;" & _ "Ptr Username" Local $tdata=DllStructCreate($structCREDENTIAL, $Ret[4]) Local $userName = DllStructCreate("wchar[513]", DllStructGetData($tdata, 'Username')) Local $User = DllStructGetData($userName, 1) Local $CredentialBlobSize = DllStructGetData($tdata, 'CredintialBlobSize') Local $credentialBlob = DllStructCreate("wchar[512]", DllStructGetData($tdata, 'CredentialBlob')) Local $Password = StringLeft(DllStructGetData($credentialBlob, 1), $CredentialBlobSize/2) Local $Comment = DllStructCreate("wchar[256]", DllStructGetData($tdata, 'Comment')) Local $Comm = DllStructGetData($Comment, 1) Dim $FuncRet[] = [$User, $Password, $Comm] Return $FuncRet EndFunc ;_Cred_Get
  3. I tried that code and it is not doing anything. It just immediately exits and returns no information.
  4. I am going to try the code again tomorrow but I have included a screen shot of an example credential I am trying to pull from credential manager. Before I waste hours playing around with code, is it possible to pull the username and password?
  5. I tried your code but it is not doing anything for me.
  6. Is it possible to read credentials from Windows Credential Manager? I am trying to pull them to a login screen but I cannot figure out how to connect and retrieve the data. I want to avoid having to read from an INI file.
  7. I was able to just get this to work after changing some of the settings within IE. $oIE = _IECreate ("https://businesslogin.cerner.com/?ReturnUrl=https%3A%2F%2Fdistributions.cerner.com%2F") _IELoadWait($oIE) _IELinkClickByText($oIE, "Log in with CernerCare")
  8. @Danp2 Yours works but only when I had a second instance of IE running.
  9. I am still getting the same error after trying the things you suggested.
  10. I am seeing the following in the console when I try your code: --> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147023174, Browser has been deleted prior to operation.) --> IE.au3 T3.0-2 Error from function _IETagNameGetCollection, $_IESTATUS_InvalidObjectType "C:\Visual Studio\AIS\AIS Package Management\AutoIT\Install Hist Export.au3" (8) : ==> Variable must be of type "Object".: For $oTag in $oTags For $oTag in $oTags^ ERROR >Exit code: 1 Time: 2.647
  11. Hello, For the following URL (https://businesslogin.cerner.com/?ReturnUrl=https%3A%2F%2Fdistributions.cerner.com%2F), I am trying to click the button called "Log in with CernerCare". I have tried many different methods but none have worked. Things I have tried include: Local $oDivs = _IETagNameGetCollection($oIE, "div") For $oDiv In $oDivs If $oDiv.ClassName = "provider__logo" Then _IEAction($oDiv, "click") MsgBox($oDiv) Next ---------------------------- _IELinkClickByIndex($oIE,6) -------------------------- _IELinkClickByText($oIE,"Log in with CernerCare")
  12. I have another question. I love how the button colors change when you hover over them but I would like the button background color to remain a certain color when clicked but then return to the default background color when a different button is clicked. How can I do this? If _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[0] Then If Not $OverFlag[0] Then ConsoleWrite(' Over-Detection: Label1' & @CR) GUICtrlSetBkColor($MenuItems[0], $GUI_MENU_HOVER_COLOR) $OverFlag[0] = 1 EndIf ElseIf _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[1] Then If Not $OverFlag[1] Then ConsoleWrite(' Over-Detection: Label2' & @CR) GUICtrlSetBkColor($MenuItems[1], $GUI_MENU_HOVER_COLOR) $OverFlag[1] = 1 EndIf ElseIf _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[2] Then If Not $OverFlag[2] Then ConsoleWrite(' Over-Detection: Label3' & @CR) GUICtrlSetBkColor($MenuItems[2], $GUI_MENU_HOVER_COLOR) $OverFlag[2] = 1 EndIf ElseIf _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[3] Then If Not $OverFlag[3] Then ConsoleWrite(' Over-Detection: Label4' & @CR) GUICtrlSetBkColor($MenuItems[3], $GUI_MENU_HOVER_COLOR) $OverFlag[3] = 1 EndIf ElseIf _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[4] Then If Not $OverFlag[4] Then ConsoleWrite(' Over-Detection: Label4' & @CR) GUICtrlSetBkColor($MenuItems[4], $GUI_MENU_HOVER_COLOR) $OverFlag[4] = 1 EndIf Else ;#========================================# ;# Check if focus is lost on a menu item # ;#========================================# If $OverFlag[0] Then ConsoleWrite(' Focus-Loss: Label1' & @CR) GUICtrlSetBkColor($MenuItems[0], $GUI_MENU_COLOR) $OverFlag[0] = 0 ElseIf $OverFlag[1] Then ;Cerner button ConsoleWrite(' Focus-Loss: Label2' & @CR) GUICtrlSetBkColor($MenuItems[1], $GUI_MENU_COLOR) $OverFlag[1] = 0 ElseIf $OverFlag[2] Then ConsoleWrite(' Focus-Loss: Label3' & @CR) GUICtrlSetBkColor($MenuItems[2], $GUI_MENU_COLOR) $OverFlag[2] = 0 ElseIf $OverFlag[3] Then ConsoleWrite(' Focus-Loss: Label4' & @CR) GUICtrlSetBkColor($MenuItems[3], $GUI_MENU_COLOR) $OverFlag[3] = 0 ElseIf $OverFlag[4] Then ConsoleWrite(' Focus-Loss: Label4' & @CR) GUICtrlSetBkColor($MenuItems[4], $GUI_MENU_COLOR) $OverFlag[4] = 0 EndIf EndIf ;#=======================================# ;# Check if an element has been clicked # ;#=======================================# $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_PRIMARYDOWN _SendMessage($GUI_WHNDL, $WM_SYSCOMMAND, 0xF012, 0) ;#(0xF012 = MAKES GUI DRAGGABLE) Case $GUI_EVENT_CLOSE, $GUI_CLOSEBTN _MTSkin_GUIDelete($GUI_WHNDL) Exit Case $GUI_EVENT_MINIMIZE, $GUI_MINIMIZEBTN GUISetState(@SW_MINIMIZE) Case $MenuItems[0] _Home() Case $MenuItems[1] _Cerner() Case $MenuItems[2] _Caretech() Case $MenuItems[3] _IA() Case $MenuItems[4] _Settings() EndSwitch WEnd
  13. How would go about using the right pane for various pages? When I use the left pane for navigation, the data just rights on top of itself in the right pane.
  14. I just started using this UDF to send alerts to my ATT phone number and I am unable to get anything to display in the message portion of the alert. $service = $ATT_WIRELESS $subject = "There is a high priority ticket" $from = "Test" $sms = _SMS_Start($server,$email,$username,$password,$port,$ssl) _SMS_Send($sms,$number,$service,$subject,$from) I am seeing FRM: xxxxx SUBJ: xxxxxxx MSG: [blank]
  15. @Danp2 Unless I am not looking in the right place, I am not seeing much being written to the output box at the bottom. That's why I didn't include it. I will try your suggestions though. Thanks!
  16. Hello, I am trying to click the link in the image highlighted with the red box. I am doing something wrong because I am getting no where. Any help would be appreciated. $oDivs = _IETagNameGetCollection ($oIE, "div") For $oDiv in $oDivs If String($oDiv.classname) = 'resource myapps-myfolder' And String($oDiv.innerText)= 'Cert' Then _IEAction($oDiv, "click") ExitLoop EndIf Next
  17. @Danp2 That worked perfectly! Thanks!
  18. Here is the error I am seeing: --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop --> IE.au3 T3.0-2 Warning from function _IEAttach, $_IESTATUS_NoMatch "C:\Users\michael.knope\Documents\AutoIT\CernerWorks Login\CWX CERT Link.au3" (41) : ==> Variable must be of type "Object".: $oUser.value = $sUser $oUser^ ERROR ->12:50:53 AutoIt3.exe ended.rc:1 +>12:50:53 AutoIt3Wrapper Finished. >Exit code: 1 Time: 2.852
  19. Hello, I am working on a script for inputting my username/password to a website that I frequent throughout the day for work. I know login scripts are a touchy subject but my computer is locked down to my access only and I plan on logging into the script with my credentials each day (stored in INI) and press a hot key to insert my username/password when I need to log in. I posted the code I am working with below. I have used this code before and it worked well but I am having an issue with focusing on username, password, and login button from the following link: https://advnmd.cernerworks.com/Citrix/ProdWeb/ Any help or direction would be appreciated. $oInputs = _IETagNameGetCollection($oIE, "input") for $oInput in $oInputs if $oInput.type = "text" And $oInput.name = "username" Then $oUser = $oInput if $oInput.type = "password" And $oInput.name = "password" Then $oPass = $oInput if $oInput.type = "submit" And $oInput.value = "Log In" 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) WEnd
  20. I was able to get it to work with the code below and send it to excel. How would I go about adding a row to add column headers? ;; analyzes and split data of the 2 arrays Func _Separate(ByRef $in0, ByRef $in1) $in0 = _ArrayUnique($in0, 0, Default, Default, 0) $in1 = _ArrayUnique($in1, 0, Default, Default, 0) Local $z[2] = [UBound($in0), UBound($in1)], $low = 1 * ($z[0] > $z[1]), $aTemp[$z[Not $low]][3], $aOut = $aTemp, $aNdx[3] For $i = 0 To $z[Not $low] - 1 If $i < $z[0] Then $aTemp[$i][0] = $in0[$i] If $i < $z[1] Then $aTemp[$i][1] = $in1[$i] Next For $i = 0 To $z[$low] - 1 $x = _ArrayFindAll($aTemp, $aTemp[$i][$low], 0, 0, 1, 0, Not $low) If Not @error Then ; both For $j = 0 To UBound($x) - 1 $aTemp[$x[$j]][2] = 1 Next $aOut[$aNdx[2]][2] = $aTemp[$i][$low] $aNdx[2] += 1 Else ; only in $low $aOut[$aNdx[$low]][$low] = $aTemp[$i][$low] $aNdx[$low] += 1 EndIf Next For $i = 0 To $z[Not $low] - 1 If $aTemp[$i][2] <> 1 Then $aOut[$aNdx[Not $low]][Not $low] = $aTemp[$i][Not $low] $aNdx[Not $low] += 1 EndIf Next ReDim $aOut[_ArrayMax($aNdx)][3] Return $aOut Func Send_to_excel() ; List all the files in the current script directory. Local $aScriptDir = _FileListToArray(@ScriptDir) ; Create a file in the users %TEMP% directory. Local $sFilePath = @TempDir & "\Examples.csv" ; Write array to a file by passing the file name. _FileWriteFromArray($sFilePath, _Separate($a, $b),0,Default,",") ; Display the file. ShellExecute($sFilePath) EndFunc work with the code below
  21. Chimp, I tried using that code and I am getting a bunch of errors.
  22. ArrayA.txt ArrayB.txt
  23. Thank you for those suggestions. When I performed the array compare using _ArrayDelete, the final array displayed has nothing in it. This is how each array looks before the comparison: Array A: Array B: Func distribution_search_b() $oForm = _IEFormGetObjByName($oIE, "frmMain") ;Get the form "Name" (view source on the page, look for "<Form" and look for the "name=" value for the name value). $oLogin = _IEFormElementGetObjByName($oForm, "pkg") ;The "email_login" is the name of the inputbox for the input (also in the view source). $oSubmit = _IEGetObjByName($oIE, "btnSubmit") _IEFormElementSetValue($oLogin, GUICtrlRead($Package_B_Input)) ;Set the login to equal this value. _IEAction($oSubmit, "click") sleep(2000) _IELinkClickByText($oIE, "Solution Changes") Global $bTable=_IEGetObjById($oIE,"CRList") Global $bTableData=_IETableWriteToArray($bTable, True) ;_ArrayDisplay($bTableData) Endfunc Func distribution_search_b() $oForm = _IEFormGetObjByName($oIE, "frmMain") ;Get the form "Name" (view source on the page, look for "<Form" and look for the "name=" value for the name value). $oLogin = _IEFormElementGetObjByName($oForm, "pkg") ;The "email_login" is the name of the inputbox for the input (also in the view source). $oSubmit = _IEGetObjByName($oIE, "btnSubmit") _IEFormElementSetValue($oLogin, GUICtrlRead($Package_B_Input)) ;Set the login to equal this value. _IEAction($oSubmit, "click") sleep(2000) _IELinkClickByText($oIE, "Solution Changes") Global $bTable=_IEGetObjById($oIE,"CRList") Global $bTableData=_IETableWriteToArray($bTable, True) ;_ArrayDisplay($bTableData) Endfunc Func Array_Compare() For $i = UBound($aTableData) - 1 To 0 step -1 For $j = UBound($bTableData) - 1 to 0 step - 1 If $aTableData[$i][1] = $bTableData[$j][1] Then _ArrayDelete($aTableData , $i) exitloop EndIf Next Next _ArrayDisplay($aTableData) EndFunc
  24. Hello, I have done a few programs to automate processes using AutoIt but I am a greenhorn when trying to do a comparison between two arrays my code is writing out. I am trying to go out to a webpage that contains a listing of Solution Changes in a table (distribution A) and compare that array to the listing of Solution changes from distribution B. Ultimately, I want to know which solution change numbers (ex 1-5091919681) exist in A but not B, and ones that exist in B but not A. I am not entirely sure where to start and thus the reason for posting this. Any help or direction would be appreciated. Func distribution_search_a() $oForm = _IEFormGetObjByName($oIE, "frmMain") $oLogin = _IEFormElementGetObjByName($oForm, "pkg") $oSubmit = _IEGetObjByName($oIE, "btnSubmit") _IEFormElementSetValue($oLogin, GUICtrlRead($Package_A_Input)) _IEAction($oSubmit, "click") sleep(2000) _IELinkClickByText($oIE, "Solution Changes") Global $aTable=_IEGetObjById($oIE,"CRList") Global $aTableData=_IETableWriteToArray($aTable) ;_ArrayDisplay($aTableData) Endfunc Func distribution_search_b() $oForm = _IEFormGetObjByName($oIE, "frmMain") $oLogin = _IEFormElementGetObjByName($oForm, "pkg") $oSubmit = _IEGetObjByName($oIE, "btnSubmit") _IEFormElementSetValue($oLogin, GUICtrlRead($Package_B_Input)) _IEAction($oSubmit, "click") sleep(2000) _IELinkClickByText($oIE, "Solution Changes") Global $bTable=_IEGetObjById($oIE,"CRList") Global $bTableData=_IETableWriteToArray($bTable) ;_ArrayDisplay($bTableData) Endfunc
×
×
  • Create New...