Bagikan melalui


WMIConn.UseWindowsAuth Properti

Definisi

Mendapatkan atau mengatur Boolean yang menunjukkan apakah Autentikasi Windows digunakan untuk koneksi.

public:
 property bool UseWindowsAuth { bool get(); void set(bool value); };
public bool UseWindowsAuth { get; set; }
member this.UseWindowsAuth : bool with get, set
Public Property UseWindowsAuth As Boolean

Nilai Properti

true jika Autentikasi Windows digunakan dalam koneksi; jika tidak, salah.

Contoh

Contoh kode berikut menambahkan koneksi WMI ke paket, dan mengatur ServerNameproperti , Namespace, dan UseWindowsAuth .

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)  

Keterangan

Nilai ini menentukan apakah properti nama pengguna atau kata sandi diperlukan. Nilai true menunjukkan bahwa Autentikasi Windows sedang digunakan, sehingga nama pengguna dan kata sandi tidak diperlukan dalam koneksi.

Berlaku untuk