Export (0) Print
Expand All
Expand Minimize

Test-SCDomainCredential

Updated: April 29, 2014

Applies To: System Center 2012 R2 Virtual Machine Manager

Test-SCDomainCredential

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

Syntax

Parameter Set: Credential
Test-SCDomainCredential [-Credential] <PSCredential> [-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<PSCredential>

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.

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"

Related topics

 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft