Udostępnij za pośrednictwem


Właściwość Server.ServiceAccount

Pobiera konto usługa, na którym uruchomiono wystąpienie programu SQL Server.

Przestrzeń nazw:  Microsoft.SqlServer.Management.Smo
Zestaw:  Microsoft.SqlServer.Smo (w Microsoft.SqlServer.Smo.dll)

Składnia

'Deklaracja
<SfcPropertyAttribute(SfcPropertyFlags.Standalone)> _
Public ReadOnly Property ServiceAccount As String
    Get
'Użycie
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

Wartość właściwości

Typ: System.String
A String wartość, która określa konta usługa dla wystąpienie SQL Server.

Przykłady

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

Zobacz także

Odwołanie

Planning a SQL Server Installation

Inne zasoby