Share via


WMIConn.ServerName Property

Definition

Gets or sets the name of the server to connect to as a WMI connection.

public:
 property System::String ^ ServerName { System::String ^ get(); void set(System::String ^ value); };
public string ServerName { get; set; }
member this.ServerName : string with get, set
Public Property ServerName As String

Property Value

A String that contains the name of the server to connect to as a WMI connection.

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)  

Applies to