Jump to content

RunAs with functions


SergeiK
 Share

Recommended Posts

Dear Script Experts,

Please, assist me to make the below code running.. I would like to run some app by logon script from the nearest domain controller, but fail. If I specify a domain cotroller explicitly - it works fine, but this code "@LogonServer & "\NETLOGON\PC\H\go.exe"" does not work... Thanks in advance!!

$UserID = "XXX";

$Password = "XXX";

RunAs ($UserID,@LogonDomain,$Password,0, @LogonServer & "\NETLOGON\PC\H\go.exe");

Link to comment
Share on other sites

Hi and Welcome to the forums!!

Maybe @LogonServer isn't what you think it is? Have you made sure?

You could show it with a MsgBox() or ConsoleWrite() (shows at the bottom of SciTE).

Example:

MsgBox(0, "", @LogonServer & "\NETLOGON\PC\H\go.exe")

Link to comment
Share on other sites

Does @LogonServer contain a space perhaps?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • 2 weeks later...

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
 Share

  • Recently Browsing   0 members

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