Jump to content

Recommended Posts

Posted (edited)
Func _PsExec1()
;~  local $iResult

    Run( @ComSpec & ' /c mkdir \\PC-Portable\c$\temptest', @SystemDir, @SW_SHOW )
        If @error <> 0 Then MsgBox(16, "Erreur", "Erreur: @error = " & @error & ", @extended: " & @extended)

    RunAsWait( "Caramen" , @ComputerName , "@jhgjfjhf" ,$RUN_LOGON_PROFILE , @ComSpec & '/k /c dircopy '&@ScriptDir&'\Data\Source1'&' \\PC-Portable\c$\temptest', @SystemDir, @SW_SHOW)
        If @error <> 0 Then MsgBox(16, "Erreur", "Erreur: @error = " & @error & ", @extended: " & @extended)

    RunAsWait( "Administrateur" , @ComputerName , "" ,$RUN_LOGON_PROFILE , @ComSpec & '/k /c PSEXEC \\PC-Portable -u Caramen -p XXXXXX "c:\temptest\test.txt"', @SystemDir, @SW_SHOW)
        If @error <> 0 Then MsgBox(16, "Erreur", "Erreur: @error = " & @error & ", @extended: " & @extended)

EndFunc

image.png.4836d70f079d3c6f6578bb50d0ce734f.png

 

Hello,

 

Why the both commands RunAsWait doing this error please :( ? I think I had the same problem before. I can't remember how we solved it. 

 

 

 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Posted (edited)

Oh wow... I discovered this can fail if I have no password set on the system account. 

A policy say : Don't allow empty password. 

And then if you use RunAs with empty password when this policy is (by default (Is that new WTF ?)) enable then RunAs will fail. <Good info for help file. 

image.png.f82600f333d73dbfcb7ddab8863d3ab1.png

Edit : Windows 10

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Posted (edited)

You also have no space between @Comspec & '/k...', also is PsExec.exe been added to a searchable path?  From memory Windows has always required a password (for connecting to shares) otherwise it would be a major security risk.

Edited by Subz
Posted

Hi caramen
I found a web site indicating thirteen different extended error values, related to RunAs and RunAsWait.
It includes your extended error value 1326 : "1326 (0x0000052e) ERROR_LOGON_FAILURE - The user name or password is incorrect."

Here is the link, in case it may help anyone in the future :
https://www.vanstechelman.eu/content/meaning-of-the-extended-flag-value-when-using-autoits-runas-and-runaswait

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted (edited)

Yo @Subz yeah I forgot about that, it's now all corrected. but still same issue. 

Hi @pixelsearch yeah it return 1326 with policy enable and 1327 is the policy not enable but password isn't same as on target computer with the same account. 

So my way to correct was to change my password and add " " before "/k" to enable my test environment. And not to disable the policy because I don't have empty password anymore, but the same as my target computer with same account. 

It was Microsoft related so... 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...