Test-SCDomainCredential

Tests a credential or user name to verify that it authenticates in the domain.

Syntax

Test-SCDomainCredential [-Credential] <VMMCredential> [-VMMServer <ServerConnection>] [<CommonParameters>]
Test-SCDomainCredential [-UserName] <String> [-VMMServer <ServerConnection>] [<CommonParameters>]

Description

The Test-SCDomainCredential cmdlet tests a credential object or user name to verify that it authenticates in the domain.

Examples

Example 1: Test the validity of a credential object

PS C:\> $Creds = Get-Credential
PS C:\> Test-SCDomainCredential -Credential $Creds

The first command prompts you for a username and password, creates a PSCredential object, and stores the object in the $Creds variable.

The second command validates the credential object in $Creds and returns either True or False.

Example 2: Test the validity of a user name

PS C:\> Test-SCDomainCredential -UserName "PattiFuller"

This command tests the validity of the user name PattiFuller and returns either True or False.

Parameters

-Credential

Specifies a credential object or, for some cmdlets, a Run As account object that contains the user name and password of an account that has permission to perform this action. Or, in the case of Restart-SCJob, has permission to complete a restarted task.

For more information about the PSCredential object, type Get-Help Get-Credential.

For more information about Run As accounts, type Get-Help New-SCRunAsAccount.

Type:VMMCredential
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-UserName

Specifies a the name of a user. Enter a user name with the format Domain\User.

Type:String
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Outputs

Boolean

This cmdlet returns a Boolean result.