Compartilhar via


Construtor WMIConn

Initializes a new instance of the WMIConn class.

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

Sintaxe

'Declaração
Public Sub New
'Uso
Dim instance As New WMIConn()
public WMIConn()
public:
WMIConn()
new : unit -> WMIConn
public function WMIConn()

Exemplos

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)

Consulte também

Referência

WMIConn Classe

Sobrecarregado WMIConn

Namespace Microsoft.SqlServer.Dts.ManagedConnections