ServerConnection.TrueLogin Property

Gets the current logon record name used by the referenced connection.

Namespace:  Microsoft.SqlServer.Management.Common
Assembly:  Microsoft.SqlServer.ConnectionInfo (in Microsoft.SqlServer.ConnectionInfo.dll)

public string TrueLogin { get; }

Property Value

Type: String
A String value that specifies the current logon record name used by the referenced connection.

C#

ServerConnection conn = new ServerConnection();
Console.WriteLine(conn.TrueLogin);

PowerShell

$conn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
Write-Host $conn.TrueLogin

Community Additions

Show: