Skip to content

Get SqlDscManagedComputerService

dscbot edited this page Mar 3, 2024 · 2 revisions

Get-SqlDscManagedComputerService

SYNOPSIS

Returns one or more managed computer service objects.

SYNTAX

ByServerName (Default)

Get-SqlDscManagedComputerService [-ServerName <String>] [-InstanceName <String[]>] [-ServiceType <String[]>]
 [<CommonParameters>]

ByServerObject

Get-SqlDscManagedComputerService -ManagedComputerObject <ManagedComputer> [-InstanceName <String[]>]
 [-ServiceType <String[]>] [<CommonParameters>]

DESCRIPTION

Returns one or more managed computer service objects, by default for the node the command is run on.

EXAMPLES

EXAMPLE 1

Get-SqlDscManagedComputer | Get-SqlDscManagedComputerService

Returns all the managed computer service objects for the current node.

EXAMPLE 2

Get-SqlDscManagedComputerService

Returns all the managed computer service objects for the current node.

EXAMPLE 3

Get-SqlDscManagedComputerService -ServerName 'MyServer'

Returns all the managed computer service objects for the server 'MyServer'.

EXAMPLE 4

Get-SqlDscManagedComputerService -ServiceType 'DatabaseEngine','AnalysisServices'

Returns all the managed computer service objects for service types 'DatabaseEngine' and 'AnalysisServices'.

EXAMPLE 5

Get-SqlDscManagedComputerService -InstanceName 'SQL2022'

Returns all the managed computer service objects for instance SQL2022.

PARAMETERS

-InstanceName

Specifies the instance name to return the services for, this will exclude any service that does not have the instance name in the service name.

Type: String[]
Parameter Sets: (All)
Aliases:

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

-ManagedComputerObject

Specifies the Managed Computer object to return the services from.

Type: ManagedComputer
Parameter Sets: ByServerObject
Aliases:

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

-ServerName

Specifies the server name to return the services from.

Type: String
Parameter Sets: ByServerName
Aliases:

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

-ServiceType

Specifies one or more service types to return the services for.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
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

OUTPUTS

[Microsoft.SqlServer.Management.Smo.Wmi.Service[]]

NOTES

RELATED LINKS

Home

General

Commands

Clone this wiki locally