Skip to content

ConvertTo SqlDscDatabasePermission

dscbot edited this page Mar 3, 2024 · 2 revisions

ConvertTo-SqlDscDatabasePermission

SYNOPSIS

Converts a collection of Microsoft.SqlServer.Management.Smo.DatabasePermissionInfo objects into an array of DatabasePermission objects.

SYNTAX

ConvertTo-SqlDscDatabasePermission [-DatabasePermissionInfo] <DatabasePermissionInfo[]>
 [<CommonParameters>]

DESCRIPTION

Converts a collection of Microsoft.SqlServer.Management.Smo.DatabasePermissionInfo objects into an array of DatabasePermission objects.

EXAMPLES

EXAMPLE 1

$serverInstance = Connect-SqlDscDatabaseEngine
$databasePermissionInfo = Get-SqlDscDatabasePermission -ServerObject $serverInstance -DatabaseName 'MyDatabase' -Name 'MyPrincipal'
ConvertTo-SqlDscDatabasePermission -DatabasePermissionInfo $databasePermissionInfo

Get all permissions for the principal 'MyPrincipal' and converts the permissions into an array of [DatabasePermission\[]\].

PARAMETERS

-DatabasePermissionInfo

Specifies a collection of Microsoft.SqlServer.Management.Smo.DatabasePermissionInfo objects.

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

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
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

[DatabasePermission[]]

NOTES

RELATED LINKS

Home

Commands

Resources

Usage

Clone this wiki locally