|
Hello everyone.
I am writing a script with the purpose of installing the EPO agent for my workstations. I wrote the script but the only thing that i am not familiar with is that I need an admin account to do it. All the machines are locked down. How would I be able to specify an admin account to install the software, or what's the best way of doing it.
What my script does is it verifies to see if a flag file is set on the computer if not it writes to the registry in the runonce key. and on the next reboot it installs the software if the flag file is not there.
Here is a copy of the code.
;---------- Script to Install Mcafee EPO Agent ;---------------------------------------------------------------------------------------------------------------- ;---------- Variable Declaration Section ;----------------------------------------------------------------------------------------------------------------
$Errfile = ("%windir%" + "\" + "epoerr.flg") $Flgfile = ("%windir%" + "\" + "epoagnt.flg") $ROKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" ;----------------------------------------------------------------------------------------------------------------
If exist ($Flgfile)
GOTO THEEND Endif
;drop the script for the epo Agent setup.exe in the runonce registry key and write the details to a log file :SETVALUE ; WRITEVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce","EPOAgent", "\\s3-ott-soft\dfsroot\Soft\VirusScan\ePOAgent_251\epo251.exe","REG_SZ") $return = @error ;? $return Select Case @error = 0 ;? "Value written to registry" OPEN(2,$Flgfile,5) Writeline(2,"EPO Installed" + " " + @date + " " + @time) CLOSE(2)
Case 1 ;? "Registry Function Failed" OPEN(2,$Errfile,5) Writeline(2,"EPO NOT Installed -- FAILED" + " " + @date + " " + @time + " " + $return + " : code") CLOSE(2) GOTO THEEND EndSelect
:THEEND EXIT
|