Test-WebSitesServer

Tests connectivity to a remote server.

Syntax

Test-WebSitesServer
    [[-Name] <String>]
    [-UserName <String>]
    [-Password <String>]
    [-ConnectionString <String>]
    [<CommonParameters>]

Description

The Test-WebSitesServer cmdlet tests Windows Management Instrumentation (WMI) connectivity to a remote server.

Examples

Example 1: Test a connection to a remote server

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

This command tests the connection to the server WSERVER01.

Parameters

-ConnectionString

Specifies a connection string for a hosting database. Connection strings contain information about a data source and how to connect to it; this information includes such things as the server and database name, and the name and password of the user account making the connection. For example:

-ConnectionString "Server=tcp:contosodb.database.windows.net;Database=Personel;User ID=admin@contoso.com;Password=p@ssw0rd;Trusted_Connection=False;Encrypt=True;"

If you do not specify this parameter, Test-WebSitesServer uses the default instance of the hosting database.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the server being tested. For example:

-Name "ContosoServer"

Type:String
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Password

Specifies password for the user account used to connect to the remote server. For example:

-Password "p@ssw0rd"

If you include the Password parameter you must also include the UserName parameter in order to specify the user account for the test. If you do not use the UserName and Password parameters the test is conducted using the credentials that the Windows PowerShell session is running under.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-UserName

Specifies the name of a user account used to connect to the remote server. For example:

-UserName "PattiF"

If you include the UserName parameter you must also include the Password parameter in order to specify the user account password. If you do not use these two parameters the test is conducted using the credentials that the Windows PowerShell session is running under.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False