Test-WebSitesServer

Test-WebSitesServer

Tests WMI connectivity to a remote server.

Syntax

Parameter Set: Default
Test-WebSitesServer [[-Name] <String> ] [-ConnectionString <String> ] [-Password <String> ] [-PipelineVariable <String> ] [-UserName <String> ] [ <CommonParameters>]


 

Detailed Description

The Test-WebSitesServer cmdlet tests WMI connectivity to a remote server using the credentials provided by the UserName and Password parameters.

Parameters

-ConnectionString<String>

Specifies a connecting string to a hosting database. If this parameter is not specified, the default instance of the hosting database is used.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Name<String>

Specifies the name of a server. This is the remote server against which you are testing the connection.

 

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

 

-Password<String>

Specifies a password.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

 

-PipelineVariable<String>

Specifies a variable to be used with the pipeline operator.

 

Aliases

pv

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-UserName<String>

Specifies a user name.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

 

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Examples

Example 1: Test a connection to a remote server

This command tests the connection to WSERVER01 with the specified credentials. If the credentials are valid, True is returned, otherwise False is returned.

PS C:\> Test-WebSitesServer -Name "WSERVER01" -UserName "Administrator" -Password "Password01"

 

Example 2: Test a connection to a remote server and store the result in a variable

This command tests the connection to WSERVER01 with the specified credentials, stores the result in the $Result variable, and displays the result to the user. Because an incorrect password was used, the output is False.

PS C:\> $Result = Test-WebSitesServer -Name "WSERVER01" -UserName "Administrator" -Password "IncorrectPassword01" ; "Result is: $Result"

 

Result is: False
 


Related topics

New-WebSitesServer

Get-WebSitesServer

Set-WebSitesServer

Restart-WebSitesServer

Repair-WebSitesServer

Remove-WebSitesServer