Remote Applications per VBScript und WMI anlegen

Das folgende Beispiel zeigt wie man unter Windows 2008 oder 2008 R2 Remote Applications (aka RemoteApps) automatisch per VBScript und WMI erzeugt.

Weitere Informationen zu den Eigenschaften finden sie unter http://msdn.microsoft.com/en-us/library/windows/desktop/bb736365(v=vs.85).aspx

Set objWMIService = GetObject("winmgmts:\\.\root\cimv2\TerminalServices")
Set objNewApp = objWMIService.Get("Win32_TSPublishedApplication").SpawnInstance_()
objNewApp.Name ="Notepad"
objNewApp.Alias = "Notepad"
objNewApp.Path = "C:\Windows\System32\Notepad.exe"
objNewApp.VPath = ""
objNewApp.IconPath = "C:\Windows\System32\Notepad.exe"
objNewApp.IconIndex = 0
objNewApp.CommandLineSetting = ""
objNewApp.RequiredCommandLine = 0
objNewApp.ShowInPortal = False
objNewApp.Put_

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert