Seite 1 von 1

Deploy Agent using Logon script

Verfasst: 19 Mär 2013, 11:14
von tjoene
Hi

I am trying to install the opsi agent using a logon script in Active Directory.
So far, I am able to call service_setup.cmd.

Code: Alles auswählen

Option Explicit
DIM fso 
DIM WshShell
DIM strCmd
DIM strUser
DIM strPass

Set fso = CreateObject("Scripting.FileSystemObject")

If (fso.FileExists("C:\Program Files\opsi.org\opsi-client-agent\opsiclientd.exe")) Then
  MsgBox "Opsi has already been installed!", "0", "Information"
Else
  Set WshShell=WScript.CreateObject("WScript.Shell")

  strCmd="\\opsi\opsi_depot\opsi-client-agent\service_setup.cmd"
  strUser="KHBO\Administrator"
  strPass="password"

  Set WshShell=CreateObject("WScript.Shell")
  WshShell.Run "runas.exe" & " /u:" & strUser & " " & strCmd
  WScript.Sleep 1000
  WshShell.Sendkeys strPass & "~"
End If
But I still get a pop-up windows from the wizard asking for the Opsi username and password.
Is it possible to pass the opsi credentials as parameters, so the user doesn't have to fill them in?


Thanks on advance,

Jeroen

Re: Deploy Agent using Logon script

Verfasst: 19 Mär 2013, 13:02
von tobias
try to use the config.ini in your opsi-client-agent package:

opsi-client-agent\files\opsi\cfg\config.ini

Re: Deploy Agent using Logon script

Verfasst: 19 Mär 2013, 15:20
von tjoene
Thanks, that worked!