Sign in to follow this  
Followers 0
SpecialK

Changing the Account for a system service?

2 posts in this topic

Hello,

can someone give me a hint how to change the Acocunt for a system service with Autoit3? I want the virus scanner to run under the local Admin account and not the (default setting) system account.

Is there a chance to change this with a script?

P.s.: Is the starting end ending of a service with Autoit3 only possible via embedded dos command "net start / stop"?

SpecialK

Share this post


Link to post
Share on other sites



Well, i have now a solution. It's not the best one but it works for me. I use the Windows MMC Gui and some Key commands for navigating.

Here is the code if you are interested:

$mapdrive = DriveMapAdd("X:", "\\XXXX\share\Packages\NetAgent 1.0", 0)
$Adminserver = InputBox("Administrationsserver", "Bitte Kaspersy Administrationsserver eingeben:", "ADMINSERVER")
run ("x:\setup.exe")
WinWaitActive("Installationsassistent - Administrationsagent", "&Weiter >")
ControlClick("Installationsassistent - Administrationsagent", "&Weiter >", 1)
WinWaitActive("Installationsassistent - Administrationsagent", "ENDBENUTZER-LIZENZVERTRAG")
ControlClick("Installationsassistent - Administrationsagent", "ENDBENUTZER-LIZENZVERTRAG", 1)
WinWaitActive("Installationsassistent - Administrationsagent", "Geben Sie Ihren Namen")
ControlSend("Installationsassistent - Administrationsagent", "Geben Sie Ihren Namen", 301, "TEST")
Send ("{TAB}")
ControlSend("Installationsassistent - Administrationsagent", "Geben Sie Ihren Namen", 302, "TEST")
ControlClick("Installationsassistent - Administrationsagent", "Geben Sie Ihren Namen", 1)
WinWaitActive("Installationsassistent - Administrationsagent", "&Weiter >")
ControlClick("Installationsassistent - Administrationsagent", "&Weiter >", 1)
WinWaitActive("Installationsassistent - Administrationsagent", "&Durchsuchen")
ControlSend("Installationsassistent - Administrationsagent", "&Durchsuchen", 305, "+{END}{DEL}" & $Adminserver)
sleep(2000)
ControlClick("Installationsassistent - Administrationsagent", "&Durchsuchen",1)
WinWaitActive("Installationsassistent - Administrationsagent", "Verwenden Sie einen")
ControlClick("Installationsassistent - Administrationsagent", "Verwenden Sie einen", 1)
WinWaitActive("Installationsassistent - Administrationsagent", "&Weiter >")
Controlclick("Installationsassistent - Administrationsagent", "&Weiter >", 1)
WinWaitActive("Installationsassistent - Administrationsagent", "&Weiter>")
Controlclick("Installationsassistent - Administrationsagent", "&Weiter>", 1)
WinWaitActive("Installationsassistent - Administrationsagent", "Abbrechen")
ControlClick("Installationsassistent - Administrationsagent", "Abbrechen", 1)
WinWaitActive("Installationsassistent - Administrationsagent", "Administrationsagent starten")
Controlclick("Installationsassistent - Administrationsagent", "Administrationsagent starten", 1)
DriveMapDel("X:")

sleep(3000)
run(@SystemDir & "\mmc.exe  " & @SystemDir & "\services.msc")
WinWaitActive ("Dienste")
Send ("{TAB}Kasperky{ENTER}")
WinWaitActive ("Eigenschaften von Kaspersky Administrationsagent (Lokaler Computer)")
Send ("^{TAB}")
WinWaitActive ("Eigenschaften von Kaspersky Administrationsagent (Lokaler Computer)", "Anmelden")
ControlClick ("Eigenschaften von Kaspersky Administrationsagent (Lokaler Computer)", "Anmelden", 227)
ControlSend ("Eigenschaften von Kaspersky Administrationsagent (Lokaler Computer)", "Anmelden", 234, "+{END}{DEL}Administrator")
ControlSend ("Eigenschaften von Kaspersky Administrationsagent (Lokaler Computer)", "Anmelden", 230, "+{END}{DEL}PASSWORD")
ControlSend ("Eigenschaften von Kaspersky Administrationsagent (Lokaler Computer)", "Anmelden", 231, "+{END}{DEL}PASSWORD")
Send ("^{TAB}")
WinWaitActive ("Eigenschaften von Kaspersky Administrationsagent (Lokaler Computer)", "Wiederherstellen")
ControlSend ("Eigenschaften von Kaspersky Administrationsagent (Lokaler Computer)", "Wiederherstellen", 247, "Die")
ControlSend ("Eigenschaften von Kaspersky Administrationsagent (Lokaler Computer)", "Wiederherstellen", 236, "Die")
ControlSend ("Eigenschaften von Kaspersky Administrationsagent (Lokaler Computer)", "Wiederherstellen", 237, "Die")
ControlClick ("Eigenschaften von Kaspersky Administrationsagent (Lokaler Computer)", "Wiederherstellen", 1)
WinWaitActive ("Dienste", "OK", 10)
ControlClick ("Dienste", "OK", 2)
RunWait(@ComSpec & ' /c net stop "Kaspersky Administrationsagent"', '', @SW_HIDE)
RunWait(@ComSpec & ' /c net start "Kaspersky Administrationsagent"', '', @SW_HIDE)

Send ("{DOWN}{ENTER}")

WinWaitActive ("Eigenschaften von Kaspersky Anti-Virus Service (Lokaler Computer)")
Send ("^{TAB}")
WinWaitActive ("Eigenschaften von Kaspersky Anti-Virus Service (Lokaler Computer)", "Anmelden")
ControlClick ("Eigenschaften von Kaspersky Anti-Virus Service (Lokaler Computer)", "Anmelden", 227)
ControlSend ("Eigenschaften von Kaspersky Anti-Virus Service (Lokaler Computer)", "Anmelden", 234, "+{END}{DEL}Administrator")
ControlSend ("Eigenschaften von Kaspersky Anti-Virus Service (Lokaler Computer)", "Anmelden", 230, "+{END}{DEL}PASSWORD")
ControlSend ("Eigenschaften von Kaspersky Anti-Virus Service (Lokaler Computer)", "Anmelden", 231, "+{END}{DEL}PASSWORD")
Send ("^{TAB}")
WinWaitActive ("Eigenschaften von Kaspersky Anti-Virus Service (Lokaler Computer)", "Wiederherstellen")
ControlSend ("Eigenschaften von Kaspersky Anti-Virus Service (Lokaler Computer)", "Wiederherstellen", 247, "Die")
ControlSend ("Eigenschaften von Kaspersky Anti-Virus Service (Lokaler Computer)", "Wiederherstellen", 236, "Die")
ControlSend ("Eigenschaften von Kaspersky Anti-Virus Service (Lokaler Computer)", "Wiederherstellen", 237, "Die")
ControlClick ("Eigenschaften von Kaspersky Anti-Virus Service (Lokaler Computer)", "Wiederherstellen", 1)
WinWaitActive ("Dienste", "OK", 10)
ControlClick ("Dienste", "OK", 2)
RunWait(@ComSpec & ' /c net stop "Kaspersky Anti-Virus Service"', '', @SW_HIDE)
RunWait(@ComSpec & ' /c net start "Kaspersky Anti-Virus Service"', '', @SW_HIDE)

SpecialK

Share this post


Link to post
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
Sign in to follow this  
Followers 0