powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Windows [игнор отключен] [закрыт для гостей] / Как автоматически регистировать в домене activex
8 сообщений из 8, страница 1 из 1
Как автоматически регистировать в домене activex
    #37480919
Фотография George-III
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Есть AD, пользователи мигрируют по машинам динамически, но мигрирующих пользователей пока нет. Под каждым пользователем на новой машине приходится изголятся для регистрации наборов необходимых *.ocx (Делаю необходимого пользователя домена локальным администратором на текущей машине, регистрирую ocx, потом убираю этого доменного пользователя из группы локальных администраторов на машине). Можно ли как-то используя службу каталогов развернуть автоматическую установку при необходимости наборов разных ocx?
...
Рейтинг: 0 / 0
Как автоматически регистировать в домене activex
    #37483019
Константин Цветков
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
George-IIIМожно ли как-то используя службу каталогов развернуть автоматическую установку Можно. Групповая политика, установка программ.
...
Рейтинг: 0 / 0
Как автоматически регистировать в домене activex
    #37539708
Фотография George-III
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Константин ЦветковGeorge-IIIМожно ли как-то используя службу каталогов развернуть автоматическую установкуМожно. Групповая политика, установка программ.
Я пробовал:
1. Стандартным способом не получается, так как можно ставить только MSI пакеты;
2. Ставить через скрипты - не получается, так как у пользователей нет админских прав.

Подскажите, как сделать правильно!
...
Рейтинг: 0 / 0
Как автоматически регистировать в домене activex
    #37539713
aleks2
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
1. WMI
2. AT.exe
3. schtasks.exe
...
Рейтинг: 0 / 0
Как автоматически регистировать в домене activex
    #37539728
Фотография George-III
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Если не затруднит можно поподробнее, я бы хотел использовать WMI, подкиньте пару примеров установки ocx
...
Рейтинг: 0 / 0
Как автоматически регистировать в домене activex
    #37539776
Константин Цветков
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Скучно:
- или
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
<OBJECT
	  classid="clsid:EE479A40-C128-40DD-93DA-000556AF9607"
	  codebase="CtrWeb.cab#version=1,1,3,1"
	  width= 915 
	  height= 585 
	  align=center
	  hspace= 0 
	  vspace= 0 
>
- или сделайте инсталлятор
- или раздел "Работа"
...
Рейтинг: 0 / 0
Как автоматически регистировать в домене activex
    #37540156
aleks2
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
George-IIIЕсли не затруднит можно поподробнее, я бы хотел использовать WMI, подкиньте пару примеров установки ocx

1. Я так понимаю, устанавливать ocx ты умеешь. Ну, т.е. знаешь чего надо запускать из командной строки...

2.
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
' RunProgram.vbs - Written by Bill Stewart (bill.stewart@frenchmortuary.com)
'
' Uses WMI to run a program on the local or a remote computer. It can also wait
' for the program to finish and optionally display an elapsed time. For
' security reasons, running a program on a remote computer always executes in a
' hidden window on Windows 2000 SP3 and later.
'
' Limitations:
'
' * A program started on a remote computer will not have network access.
' * The /wait option imposes some amount of processor overhead because it
'   repeatedly executes a WMI query to determine if the process exists.
' * Embedding double quotes in the command line is awkward because the WSH
'   runtime doesn't provide an escape mechanism (like \" to represent ", etc.)
'   As a workaround, the script uses VBScript's Unescape() function, so you
'   can type %22 (hex 22 = dec 34 = " character). Naturally, this won't work
'   if the command line actually contains %xx sequences, but this should be
'   pretty rare.
'
' Version history:
' * 1.0: Initial version.

Option Explicit

Const SCRIPT_NAME = "RunProgram.vbs"

' This constant defines the number of mulliseconds
' to wait between each WMI query when using /wait
Const PROCESS_CHECK_INTERVAL = 500

Main

' Displays the script's usage message
Sub ShowUsage()
  WScript.Echo "Runs a program on the local or a remote computer." & vbNewLine _
    & vbNewLine _
    & "Usage: " & SCRIPT_NAME & " ""<command>"" [/startin:<path>] [/window:<n>]" & vbNewLine _
    & "     [/computer:<computer> [/username:<username>] [/password:<password>]]" & vbNewLine _
    & "     [/wait [/elapsed]]" & vbNewLine _
    & vbNewLine _
    & "<command>: The command line to run (must start with an executable)." & vbNewLine _
    & "/startin: Sets the starting directory for the program." & vbNewLine _
    & "/window: Number that sets the program's initial window state. (Note: for" & vbNewLine _
    & "     security reasons, a program run on a remote computer always starts in a" & vbNewLine _
    & "     hidden window on Windows 2000 SP3 and later.)" & vbNewLine _
    & "/computer: The computer on which to run the program." & vbNewLine _
    & "/username: Connects with the specified username (requires /computer)." & vbNewLine _
    & "/password: Use the specified password (requires /computer)." & vbNewLine _
    & "/wait: Waits for the program to end." & vbNewLine _
    & "/elapsed: Displays the program's elapsed time (requires /wait)." & vbNewLine _
    & vbNewLine _
    & "Enclose the command line in double-quotes (""). To embed double quotes in the"  & vbNewLine _
    & "command line, use the string ""%22""." & vbNewLine _
    & vbNewLine _
    & "Example: " & SCRIPT_NAME & " ""cmd /c dir %22C:\Program Files%22 > C:\List.txt"""

  WScript.Quit 0
End Sub

' Returns the script host (cscript.exe or wscript.exe) in lowercase
Function ScriptHost()
  ScriptHost = LCase(Mid(WScript.FullName, Len(WScript.Path) + 2))
End Function

' Displays the elapsed time in hour(s), minute(s), and second(s) based
' on the Secs parameter
Function GetElapsed(ByVal Secs)
   Dim Result, Hrs, Mins

  Result = ""

  Hrs = Secs \ 3600
  If Hrs > 0 Then
    Result = CStr(Hrs) & " hour(s), "
    Secs = Secs - (3600 * Hrs)
  End If

  Mins = Secs \ 60
  If Mins > 0 Then
    Result = Result & CStr(Mins) & " minute(s), "
    Secs = Secs - (60 * Mins)
  End If

  GetElapsed = Result & CStr(Secs) & " second(s)"
End Function

' Main subroutine
Sub Main()
  Dim Args
  Dim Command, StartIn, Computer, UserName, Password
  Dim Wait, Elapsed
  Dim ShowWindow, Result
  Dim StartTime, EndTime
  Dim Output, TimeInfo
  Dim WMIRun

  Set Args = WScript.Arguments

  ' If there are no unnamed arguments, or if the /? argument
  ' is present, show the usage message
  If (Args.Unnamed.Count = 0) Or Args.Named.Exists("?") Then _
    ShowUsage

  ' CALLOUT A
  Command = Unescape(Args.Unnamed(0))
  ' END CALLOUT A

  StartIn = Args.Named("startin")

  ShowWindow = Args.Named("window")
  If Not IsNumeric(ShowWindow) Then ShowUsage
  If (ShowWindow < 0) Or (ShowWindow > 65535) Then ShowUsage

  Computer = Args.Named("computer")
  UserName = Args.Named("username")
  Password = Args.Named("password")

  Wait = Args.Named.Exists("wait")
  Elapsed = Args.Named.Exists("elapsed")

  ' Create instance of class
  ' CALLOUT B
  Set WMIRun = New WMIExec
  ' END CALLOUT B

  Result = WMIRun.ConnectServer(Computer, UserName, Password)
  If Result <> 0 Then
    WScript.Echo "Error 0x" & Hex(Result) & " connecting to '" _
      & Computer & "'"
    WScript.Quit Result
  End If

  If Elapsed Then StartTime = Now()

  Result = WMIRun.RunProgram(Command, StartIn, ShowWindow)
  If Result <> 0 Then
    WScript.Echo "Error 0x" & Hex(Result) & " starting '" _
      & Command & "'"
    WScript.Quit Result
  End If

  ' Output initial status message
  WScript.Echo WMIRun.Status

  If Wait Then
    ' Suspend script while process is running
    Do While WMIRun.ProcessExists()
      WScript.Sleep PROCESS_CHECK_INTERVAL
    Loop
    If Elapsed Then
      EndTime = Now()
      TimeInfo = "Started: " & CStr(StartTime) & vbNewLine _
        & "Ended: " & CStr(EndTime) & vbNewLine _
        & "Elapsed: " & GetElapsed(DateDiff("s", StartTime, EndTime))
      ' Output full status if running from wscript.exe
      If ScriptHost() = "wscript.exe" Then
        Output = WMIRun.Status & vbNewLine & TimeInfo
      Else
        Output = TimeInfo
      End If
      WScript.Echo Output
    End If
  End If
End Sub

' WMIExec class definition
Class WMIExec
  ' The c_ prefix denotes variables global to the class
  Private c_SWbemServices
  Private c_Server, c_Command, c_StartIn
  Private c_ProcID

  ' Connects to the specified computer; returns 0 for success
  Public Function ConnectServer(ByVal Server, ByVal User, _
    ByVal Password)
    Dim SWbemLocator

    ' Update the class variable
    c_Server = Server

    ' Assume the local computer if not specified
    If c_Server = "" Then c_Server = "."

    ' Ignore user and password if connecting
    ' to the local computer
    If c_Server = "." Then
      User = ""
      Password = ""
    End If

    Set SWbemLocator = CreateObject("WbemScripting.SWbemLocator")
    SWbemLocator.Security_.ImpersonationLevel = 3  ' impersonate

    On Error Resume Next
    Set c_SWbemServices = SWbemLocator.ConnectServer(c_Server, _
      "root/cimv2", User, Password)

    ConnectServer = Err.Number
  End Function

  ' Run the specified command line, starting in the specified
  ' directory, with the specified initial window state; returns
  ' 0 for success
  Public Function RunProgram(ByVal Command, ByVal StartIn, _
    ByVal ShowWindow)
    Dim Startup, Process

    ' Update the class variables
    c_Command = Command
    c_StartIn = StartIn

    ' Create a Win32_ProcessStartup object and configure
    ' its ShowWindow property
    Set Startup = _
      c_SWbemServices.Get("Win32_ProcessStartup").SpawnInstance_()
    Startup.ShowWindow = ShowWindow

    Set Process = c_SWbemServices.Get("Win32_Process")
    RunProgram = Process.Create(c_Command, c_StartIn, Startup, c_ProcID)
  End Function

  ' Returns True if the process exists
  Public Function ProcessExists()
    ProcessExists = c_SWbemServices.ExecQuery("SELECT ProcessID FROM " _
      & "Win32_Process WHERE ProcessID=" & c_ProcID).Count > 0
  End Function

  ' Returns a status message using the class variables
  Public Function Status()
    Dim Server, StartIn

    If c_Server = "." Then Server = "(LocalSystem)"
    If c_StartIn = "" Then StartIn = "(Default)" Else StartIn = c_StartIn

    Status = "Computer: " & Server & vbNewLine _
      & "Command line: " & c_Command & vbNewLine _
      & "Starting directory: " & StartIn & vbNewLine _
      & "Process ID: " & CStr(c_ProcID)
  End Function
End Class
...
Рейтинг: 0 / 0
Как автоматически регистировать в домене activex
    #37541922
Фотография George-III
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
aleks2,

Спасибо!!!
...
Рейтинг: 0 / 0
8 сообщений из 8, страница 1 из 1
Форумы / Windows [игнор отключен] [закрыт для гостей] / Как автоматически регистировать в домене activex
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]