Partager via


ComputerInfo.GetComputerDomain Method

Gets a NetBIOS domain name of the specified computer. This method is only supported on computers that are joined to a domain.

On computers that are not joined to a domain, this method throws TfsAdminException exception.

Namespace:  Microsoft.TeamFoundation.Common
Assembly:  Microsoft.TeamFoundation.Common (in Microsoft.TeamFoundation.Common.dll)

Syntax

'Declaration
Public Shared Function GetComputerDomain ( _
    computerNameOrAddress As String, _
    logger As ITFLogger _
) As String
public static string GetComputerDomain(
    string computerNameOrAddress,
    ITFLogger logger
)
public:
static String^ GetComputerDomain(
    String^ computerNameOrAddress, 
    ITFLogger^ logger
)
static member GetComputerDomain : 
        computerNameOrAddress:string * 
        logger:ITFLogger -> string
public static function GetComputerDomain(
    computerNameOrAddress : String, 
    logger : ITFLogger
) : String

Parameters

  • computerNameOrAddress
    Type: System.String

    DNS or NetBIOS name of the computer or its ip address.

Return Value

Type: System.String

Exceptions

Exception Condition
ArgumentNullException

computerNameOrAddress is null.

ArgumentException

computerNameOrAddress is an empty string.

SocketException

An error is encountered when resolving the computer name.

TfsAdminException

Cannot resolve domain name.

.NET Framework Security

See Also

Reference

ComputerInfo Class

Microsoft.TeamFoundation.Common Namespace