Get-SqlServer

Gets an SMO Server object.

Syntax

Get-SqlServer [-sqlserver] <String> [[-username] <String>] [[-password] <String>] [<CommonParameters>]

Detailed Description

The Get-SqlServer function gets a SMO Server object for the specified SQL Server.

Related Commands

* Get-SqlServer

Parameters

Name Description Required? Pipeline Input Default Value
sqlserver    true  false   
username    false  false   
password    false  false   

Input Type

None You cannot pipe objects to Get-SqlServer

Return Values

Microsoft.SqlServer.Management.Smo.Server Get-SqlServer returns a Microsoft.SqlServer.Management.Smo.Server object.

Examples

EXAMPLE 1

Get-SqlServer "Z002\sql2K8"
This command gets an SMO Server object for SQL Server Z002\SQL2K8.

EXAMPLE 2

Get-SqlServer "Z002\sql2K8" "sa" "Passw0rd"
This command gets a SMO Server object for SQL Server Z002\SQL2K8 using SQL authentication.