Bagikan melalui


WMIConn Constructor

Initializes a new instance of the WMIConn class.

Namespace:  Microsoft.SqlServer.Dts.ManagedConnections
Assembly:  Microsoft.SqlServer.ManagedConnections (in Microsoft.SqlServer.ManagedConnections.dll)

Syntax

'Declaration
Public Sub New
'Usage

Dim instance As New WMIConn()
public WMIConn()
public:
WMIConn()
new : unit -> WMIConn
public function WMIConn()

Examples

The following code example adds a WMI connection to a package, and sets the ServerName, Namespace, and UseWindowsAuth properties.

ConnectionManager WmiConn = pkg.Connections.Add("WMI");
DtsProperty prop = WmiConn.Properties["ServerName"];
prop.SetValue(WmiConn, @"\\localhost");
WmiConn.Properties["Namespace"].SetValue(WmiConn, @"\root\myfolder");
WmiConn.Properties["UseWindowsAuth"].SetValue(WmiConn, true);
Dim WmiConn As ConnectionManager =  pkg.Connections.Add("WMI") 
Dim prop As DtsProperty =  WmiConn.Properties("ServerName") 
prop.SetValue(WmiConn, "\\localhost")
WmiConn.Properties("Namespace").SetValue(WmiConn, "\root\myfolder")
WmiConn.Properties("UseWindowsAuth").SetValue(WmiConn, True)