ServiceAccount 属性
获取用来运行 SQL Server 实例的服务帐户。
命名空间: Microsoft.SqlServer.Management.Smo
程序集: Microsoft.SqlServer.Smo(在 Microsoft.SqlServer.Smo.dll 中)
语法
声明
<SfcPropertyAttribute(SfcPropertyFlags.Standalone)> _
Public ReadOnly Property ServiceAccount As String
Get
用法
Dim instance As Server
Dim value As String
value = instance.ServiceAccount
[SfcPropertyAttribute(SfcPropertyFlags.Standalone)]
public string ServiceAccount { get; }
[SfcPropertyAttribute(SfcPropertyFlags::Standalone)]
public:
property String^ ServiceAccount {
String^ get ();
}
[<SfcPropertyAttribute(SfcPropertyFlags.Standalone)>]
member ServiceAccount : string
function get ServiceAccount () : String
属性值
类型:System. . :: . .String
一个 String 值,该值指定 SQL Server 实例的服务帐户。
示例
C#
Server srv = new Server("(local)");
Console.WriteLine("The SQL Server service account is:" + srv.ServiceAccount);
PowerShell
$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
Write-Host "The SQL Server service account is:" $srv.ServiceAccount
请参阅
参考
Planning a SQL Server Installation