Get‑SqlDscManagedComputerInstance - dsccommunity/SqlServerDsc GitHub Wiki

SYNOPSIS

Returns managed computer server instance information.

SYNTAX

ByServerName (Default)

Get-SqlDscManagedComputerInstance [-ServerName <String>] [-InstanceName <String>]
 [<CommonParameters>]

ByManagedComputerObject

Get-SqlDscManagedComputerInstance [-InstanceName <String>] -ManagedComputerObject <ManagedComputer>
 [<CommonParameters>]

DESCRIPTION

Returns managed computer server instance information for a SQL Server instance using SMO (SQL Server Management Objects). The command can retrieve a specific instance or all instances on a managed computer.

EXAMPLES

EXAMPLE 1

Get-SqlDscManagedComputerInstance -InstanceName 'MSSQLSERVER'

Returns the default SQL Server instance information from the local computer.

EXAMPLE 2

Get-SqlDscManagedComputerInstance -ServerName 'MyServer' -InstanceName 'MyInstance'

Returns the MyInstance SQL Server instance information from the MyServer computer.

EXAMPLE 3

Get-SqlDscManagedComputerInstance -ServerName 'MyServer'

Returns all SQL Server instances information from the MyServer computer.

EXAMPLE 4

Get-SqlDscManagedComputer -ServerName 'MyServer' | Get-SqlDscManagedComputerInstance -InstanceName 'MyInstance'

Uses pipeline input to retrieve a specific instance from a managed computer object.

PARAMETERS

-InstanceName

Specifies the name of the SQL Server instance to retrieve. If not specified, all instances are returned.

Type: String
Parameter Sets: (All)
Aliases:

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

-ManagedComputerObject

Specifies a managed computer object from which to retrieve server instances. This parameter accepts pipeline input from Get-SqlDscManagedComputer.

Type: ManagedComputer
Parameter Sets: ByManagedComputerObject
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ServerName

Specifies the name of the server where the SQL Server instance is running. Defaults to the local computer name.

Type: String
Parameter Sets: ByServerName
Aliases:

Required: False
Position: Named
Default value: (Get-ComputerName)
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer

A managed computer object can be piped to this command.

OUTPUTS

Microsoft.SqlServer.Management.Smo.Wmi.ServerInstance

Returns server instance objects from SMO (SQL Server Management Objects).

NOTES

This command uses SMO (SQL Server Management Objects) to retrieve server instance information from the specified managed computer.

RELATED LINKS

⚠️ **GitHub.com Fallback** ⚠️