4
I need to run the ocsinventory agent installation automatically via script, which will be started by the domain’s GPO, and can be in . bat, . vbs or powershell, and there can be no user interaction. I have read and tested all the literature of the OCS documentation, but without success, because *seems to be outdated. I have already used the methods psexec.exe and msiexec.exe*, but the installation window insists on appearing to the user.
Follow my used code:
ECHO OFF
title *** INSTALACAO ***
START \\server\compartilhamento\ocsinventoryagent.exe /server=https://162.0.0.1/ocsinventory /NOW /NOLICPROMPT /TIMER:0
EXIT
Even with using argument/parameter /NOLICPROMPT
, the system window opens and asks if it is to run and asks permission from UAC.
I need to do the installation without pressing the buttons NEXT
or SIM
and with administrator rights. I have tried to do with the method:
psexec \\* -s -u Domain\Administrator -p Password \\Server\NetLogon\OCS-NG-Windows-Agent-Setup.exe /S /NOSPLASH /SERVER=http://my_ocs_server/ocsinventory
Unsuccessful too!
I managed with the following vbs script:
On error resume next 
 
Dim WshShell, fso 
Set WshShell = WScript.CreateObject("WScript.Shell") 
Set fso = CreateObject("Scripting.FileSystemObject") 

WshShell.Run "runas /user:DOMÍNIO\Administrator ""\\162.0.0.1\publico\agenteocs.exe /QUIET /S /NOW """

WScript.Sleep 1500

WshShell.Sendkeys "password~"
 
'Envia senha para o usuário adminstrator'
– Anderson Fidelis