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
Is it possible to pass the opsi credentials as parameters, so the user doesn't have to fill them in?
Thanks on advance,
Jeroen