Compartir a través de


Server.ServiceAccount Propiedad

Gets the service account under which the instance of SQL Server is running.

Espacio de nombres:  Microsoft.SqlServer.Management.Smo
Ensamblado:  Microsoft.SqlServer.Smo (en Microsoft.SqlServer.Smo.dll)

Sintaxis

'Declaración
<SfcPropertyAttribute(SfcPropertyFlags.Standalone)> _
Public ReadOnly Property ServiceAccount As String 
    Get
'Uso
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

Valor de la propiedad

Tipo: System.String
A String value that specifies service account for the instance of SQL Server.

Ejemplos

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

Vea también

Referencia

Server Clase

Espacio de nombres Microsoft.SqlServer.Management.Smo

Planning a SQL Server Installation

Otros recursos

Administrar servidores