Jump to content

Tumulus

Active Members
  • Posts

    44
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Tumulus's Achievements

Seeker

Seeker (1/7)

2

Reputation

  1. Yeah. Great idea there. Thanks!
  2. That makes sense. I could possibly take the #require admin off... SCCM is the goal, though if we have compliance issues (our SCCM isn't as reliable as we would like) then GPO is an option.
  3. I turned off SCEP and firewall but the error still persisted. However, I took the file from off of my personal network drive and copied it to the desktop. It runs just fine from there. Would there be an issue with permissions when accessing the script from my drive or something? I've never had issues before, although I am using a different machine today than the one I usually use.
  4. Possibly the AV. I can check SCEP, though I don't think we have updated since yesterday when the script was working. I'll poke around and let you know.
  5. That is actually a good point. Also, scary article. Glad I don't use Teamviewer for personal stuff. I'll be sure to forward that around. Appears that our passwords really could use an update. What could I use in place of the pid? Could I put "TeamViewer" in place of it? Also, I ran into an issue using Run and couldn't quite figure it out, so did this as a work around. I'll give run another look.
  6. I have a code that will open an application we use for remote connections here at work and then change the password for it. We were audited recently and told our security was a bit lax, so we are overhauling our password convention and changing our current passwords. This script was working until just this morning and then started to give an error right at the cusp of QA testing. It says "Line 0 ("M:\Scripts\AutoIT\TVPasswordChange.au3"): Error: Error opening the file" I haven't seen this before, and I don't think we made any significant changes to our code (I added the two control sends to delete the contents of the password field) that could have caused it. Any ideas why it might be failing to open? #RequireAdmin Global $SingleClick = 1 If ProcessExists(13696) Then MsgBox(0, "", "TeamViewer process already exists. Closing process.") ProcessClose(13696) ProcessWaitClose(13696) EndIf Run("cmd") WinWaitActive("Administrator") Send("cd C:\Program Files (x86)\TeamViewer\Version8\") Send("{Enter}") Send("TeamViewer.exe") Send("{ENTER}") WinWaitActive("TeamViewer") Sleep (1000) $pos = WinGetPos("[ACTIVE]") $x = 115 $y = 40 MouseClick("left", $pos[0] + $x, $pos[1] + $y) ;clicks "Extras" Sleep (500) MouseClick("left", $pos[0] + $x + 15, $pos[1] + $y + 25) ;clicks "Options" Sleep (500) WinWaitActive("TeamViewer options") ControlClick("TeamViewer options", "TvOptionList", 20586, "left", $SingleClick, 32, 48) ;clicks "Security" Sleep (500) ControlSend("TeamViewer options", "", 20065, "^a{BS}");deletes the password field Sleep (500) ControlSend("TeamViewer options", "", 20065, "password");types in "Password" field Sleep (500) ControlSend("TeamViewer options", "", 20066, "^a{BS}");deletes the confirm password field Sleep (500) ControlSend("TeamViewer options", "", 20066, "password");types in "Confirm Password" field Sleep (500) ControlClick("TeamViewer options", "O&K", 1, "left", $SingleClick, 40, 10);clicks "OK" MsgBox(0, "SUCCESS", "The Teamviewer password has been succesfully changed") WinClose("TeamViewer") WinClose("Administrator")
  7. Got ya. Well thanks!
  8. Interesting. That totally fixed the problem and made the script run correctly... Why would that be? Does #requireadmin need to run in an administrative SciTE? I don't remember needing it before.
  9. Still seeing nothing in the console. The array display does appear however... #RequireAdmin #include<LocalAccount.au3> #include<Array.au3> Global $aNames = '' $aNames = _GroupEnumMembers('Administrators') _ArrayDisplay($aNames) ConsoleWrite(@CRLF & 'The bound is: ' & UBound($aNames) & @CRLF) For $i = 1 to UBound($aNames) - 1 If $aNames[$i] <> '(desired name)' Then ConsoleWrite(@CRLF & 'Account Deleted: ' & $aNames[$i] & @CRLF) _AccountDelete($aNames[$i]) EndIf Next Any idea why?
  10. Yes. We are trying to get rid of all admin accounts other than a desired account. We have a lot of computers that have different accounts or multiple accounts, so we are setting a default account on all computers and then running this script. Hmm... that would write exactly what I want to the console, but the odd thing is that nothing is being written there from either ConsoleWrite. Do you have any idea why? Did I perhaps change a setting by accident? This is what my console shows after running the script: >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "M:\Work Docs\Scripts\AutoIT\ChangeLocalAdmin\DeleteLocalAdminTest.au3" /UserParams +>15:47:21 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0 Keyboard:00000409 OS:WIN_81/ CPU:X64 OS:X64 Environment(Language:0409) +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper >Running AU3Check (3.3.12.0) from:C:\Program Files (x86)\AutoIt3 input:M:\Work Docs\Scripts\AutoIT\ChangeLocalAdmin\DeleteLocalAdminTest.au3 +>15:47:21 AU3Check ended.rc:0 >Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\autoit3.exe "M:\Work Docs\Scripts\AutoIT\ChangeLocalAdmin\DeleteLocalAdminTest.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop +>15:47:21 AutoIt3.exe ended.rc:0 +>15:47:21 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.4974
  11. Alright, I looked over the code and made a few changes based on all these suggestions. Looks like I was not quite correct in a number of places. Here is what I've got. I included #require admin (oops), used _GroupEnumMembers, checked the Ubound, and moved the Next. #RequireAdmin #include<LocalAccount.au3> #include<Array.au3> Global $aNames = '' $aNames = _GroupEnumMembers('Administrators') _ArrayDisplay($aNames) ConsoleWrite(UBound($aNames)) For $i = 1 to UBound($aNames) - 1 If $aNames[$i] <> "(desired name)" Then _AccountDelete($aNames[$i]) EndIf Next Still doesn't delete what I want, and oddly enough, I am not seeing my console write anymore...
  12. @AdamUL Thanks for the info there! That has got to be my problem. I wondered where the 4 account was coming from... I should have looked into it more. I'll fix that and see if that works.
  13. I fixed both the Next positioning and checked the Ubound. It gives the correct number I need. I don't get the If syntax error anymore with the next fixed, but I am still not getting the accounts to actually delete. I've used this command in the UDF before, so it has to be something else.
  14. I have a script to delete unwanted admin accounts from our computers. I put the names into an array and then compare each member to a specific user name. If they don't match, I intend to delete them, but when my script enters the if statement I encounter an error. "M:\Work Docs\Scripts\AutoIT\ChangeLocalAdmin\DeleteLocalAdminTest.au3" (13) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: If $aNames[$i] <> "(desired account name)" Then If ^ ERROR It then exits with code 1. #include<LocalAccount.au3> #include<Array.au3> Global $aNames = '' Global $Output = '' $aNames = _AccountEnum() _ArrayDisplay($aNames) For $i = 0 to UBound($aNames) - 1 Next If $aNames[$i] <> "(desired name)" Then _AccountDelete($aNames[$i]) EndIf What is my mistake here?
  15. Yeah, I agree. However, our supervisor wants a script solution. Why he does is beyond me.
×
×
  • Create New...