dbTalk Databases Forums  

WMI commandline SSIS Script Component

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss WMI commandline SSIS Script Component in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Pinky9595
 
Posts: n/a

Default WMI commandline SSIS Script Component - 12-22-2009 , 01:01 PM






Question: The WMI return value only returns if the command line is submitted.
How can you tell if it finished and what value was returned?


This is my SSIS Script Component

'WMI section
'
Dim manScope As ManagementScope
Dim ConnOptions As ConnectionOptions
Dim ObjectGetOptions As ObjectGetOptions
ConnOptions = New ConnectionOptions
ConnOptions.Impersonation = ImpersonationLevel.Impersonate
ConnOptions.EnablePrivileges = True

Dim path As New System.Management.ManagementPath("mycomputer" &
"\root\cimv2:Win32_Process")
Dim scope As New System.Management.ManagementScope(path, ConnOptions)
scope.Connect()
Dim opt As New System.Management.ObjectGetOptions()
Dim processClass As New System.Management.ManagementClass(scope,
path, opt)
processClass = New ManagementClass(scope, path, opt)
Dim processStartupClass As ManagementClass
Dim cmd As String
Dim inParams As ManagementBaseObject =
processClass.GetMethodParameters("Create")
inParams("CommandLine") = mycommand
inParams("ProcessStartupInformation") = processStartupClass
Dim outParams As ManagementBaseObject =
processClass.InvokeMethod("Create", inParams, Nothing)


MsgBox(outParams("returnValue").ToString, MsgBoxStyle.DefaultButton1)
MsgBox(outParams("processId").ToString, MsgBoxStyle.DefaultButton1)

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.