Jump to content

RunAsSet and RunAS


SnArF
 Share

Recommended Posts

In a logon script I use RunAsSet, now it's replaced with RunAs.

Can someone tell me how to use RunAs in stead of RunAsSet in the following script....

CODE
#region ----- RunAsSet Enable -----------------------------------------------------------

_update("Gathering Information", 1)

RunAsSet($SALogin, $domain, $SAPassword)

_Debug(" [sALogon.]")

#endregion

#region ----- System Settings -----------------------------------------------------------

_update("System Settings", 2)

;Computer comment

$val = Run(@ScriptDir & '\comments.exe "' & $ldap & '"', "", @SW_HIDE)

$val = RunWait(@ComSpec & ' /c net config server /srvcomment:"' & $user & '"', 'c:', @SW_HIDE)

_Debug("Computer comment [" & $user & "].")

Sleep(100)

#endregion

#region ----- Applying Updates ----------------------------------------------------------

_update("Applying Updates", 3)

If RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\ePolicy Orchestrator\Agent', 'Installed Path') = "" Then

Run('\\nlfl1003sv\g$\software\mcafee\setupvse.exe', 'c:')

EndIf

RegDelete("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\PDdb")

RegDelete("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources","PDdb")

RegDelete("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\Sales_BeNe")

RegDelete("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources","Sales_BeNe")

If $disable_updates=0 Then

If IniRead(@WindowsDir & '\sga-setup.ini', 'Main', 'Stamp', 0) < FileGetTime(@ScriptDir & '\update.exe', 0, 1) Then

RunWait(@ScriptDir & '\update.exe', 'c:', @SW_HIDE)

_Debug("External Updates required.")

EndIf

EndIf

Sleep(100)

#endregion

Run("cmd /c net time /domain:za /set /y", "c:\", @SW_HIDE)

_Debug("Time settings.")

Sleep(100)

#region ----- RunAsSet Disable ----------------------------------------------------------

RunAsSet()

_Debug(" [sALogoff.]")

#endregion

My scripts: _ConsoleWriteLog | _FileArray2D

 

 

 

Link to comment
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
 Share

  • Recently Browsing   0 members

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