Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Get-AzResourceLock
- Module:
- Az.Resources Module
Gets a resource lock.
Syntax
ByResourceGroup
Get-AzResourceLock
-ResourceGroupName <String>
[-LockName <String>]
[-AtScope]
[-ApiVersion <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByResourceGroupLevel
Get-AzResourceLock
-ResourceName <String>
-ResourceType <String>
-ResourceGroupName <String>
[-LockName <String>]
[-AtScope]
[-ApiVersion <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
BySpecifiedScope
Get-AzResourceLock
-Scope <String>
[-LockName <String>]
[-AtScope]
[-ApiVersion <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
BySubscription
Get-AzResourceLock
[-LockName <String>]
[-AtScope]
[-ApiVersion <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
BySubscriptionLevel
Get-AzResourceLock
-ResourceName <String>
-ResourceType <String>
[-LockName <String>]
[-AtScope]
[-ApiVersion <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByLockId
Get-AzResourceLock
-LockId <String>
[-AtScope]
[-ApiVersion <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzResourceLock cmdlet gets Azure resource locks.
Examples
Example 1: Get a lock
Get-AzResourceLock -LockName "ContosoSiteLock" -ResourceName "ContosoSite" -ResourceType "microsoft.web/sites" -ResourceGroupName "ResourceGroup11"
This command gets the resource lock named ContosoSiteLock.
Example 2: Get locks at resource group level or higher
Get-AzResourceLock -ResourceGroupName "ResourceGroup11" -AtScope
This command gets the resource locks on the resource group or the subscription.
Parameters
-ApiVersion
Specifies the version of the resource provider API to use. If you do not specify a version, this cmdlet uses the latest available version.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-AtScope
Indicates that this cmdlet returns all locks at or above the specified scope. If you do not specify this parameter, the cmdlet returns all locks at, above, or below the scope.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
-LockId
Specifies the ID of the lock that this cmdlet gets.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | Id, ResourceId |
Parameter sets
-LockName
Specifies the name of the lock that this cmdlet gets.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | ExtensionResourceName, Name |
Parameter sets
-Pre
Indicates that this cmdlet considers pre-release API versions when it automatically determines which version to use.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ResourceGroupName
Specifies the name of the resource group for which the lock applies. This cmdlet gets locks for this resource group.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ResourceName
Specifies the name of the resource for which this lock applies. This cmdlet gets locks for this resource.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ResourceType
Specifies the resource type of the resource for which this lock applies. This cmdlet gets locks for this resource.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Scope
Specifies the scope to which the lock applies. The cmdlet gets locks for this scope.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
String
Outputs
PSObject
Related Links
Azure PowerShell
Feedback
Was this page helpful?
