Test-SCDomainCredential

Test-SCDomainCredential

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

Syntax

Parameter Set: Credential
Test-SCDomainCredential [-Credential] <VMMCredential> [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: UserName
Test-SCDomainCredential [-UserName] <String> [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed Description

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

Parameters

-Credential<VMMCredential>

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.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-UserName<String>

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

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Boolean

Examples

Example 1: Test the validity of a credential object

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

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

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

Example 2: Test the validity of a user name

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

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

Restart-SCJob

New-SCRunAsAccount