Bearbeiten

Freigeben über


Set-AzNotificationHubsNamespace

Sets property values for a notification hub namespace.

Syntax

Set-AzNotificationHubsNamespace
   [-ResourceGroup] <String>
   [-Namespace] <String>
   [-Location] <String>
   [[-State] <NamespaceState>]
   [[-Critical] <Boolean>]
   [[-Tag] <Hashtable>]
   [[-SkuTier] <String>]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-AzNotificationHubsNamespace cmdlet sets the property values of an existing notification hub namespace. Namespaces are logical containers that help you organize and manage your notification hubs. You must have at least one notification hub namespace. Additionally, all notification hubs must have an assigned namespace. This cmdlet is primarily used to enable and disable a namespace. When a namespace is disabled, users cannot connect to any of the notification hubs in the namespace, nor can administrators use those hubs to send push notifications. To re-enable a disabled namespace, use this cmdlet to set the State property of the namespace to Active. You can also use this cmdlet to tag a namespace as critical. This prevents the namespace from being deleted. To remove a critical namespace you must first remove the Critical tag.

Examples

Example 1: Disable a namespace

Set-AzNotificationHubsNamespace -Namespace "ContosoPartners" -Location "West US" -ResourceGroup "ContosoNotificationsGroup" -State "Disabled" -SkuTier "Standard"

This command disables the Standard tier namespace named ContosoPartners located in the West US datacenter and assigned to the ContosoNotificationsGroup resource group.

Example 2: Enable a namespace

Set-AzNotificationHubsNamespace -Namespace "ContosoPartners" -Location "West US" -ResourceGroup "ContosoNotificationsGroup" -State "Active" -SkuTier "Standard"

This command enables the Standard tier namespace named ContosoPartners located in the West US datacenter and assigned to the ContosoNotificationsGroup resource group.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Critical

Indicates whether the namespace is a critical namespace. Critical namespaces cannot be deleted. To delete a critical namespace, you must set the value of this property to False in order to mark the namespace as non-critical.

Type:Boolean
Position:4
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Do not ask for confirmation.

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

-Location

Specifies the display name of the datacenter that hosts the namespace. Although you can set this parameter to any valid Azure location, for optimal performance you should use a datacenter located near the majority of your users. To get an up-to-date list of Azure locations run the following command: Get-AzLocation | Select-Object DisplayName

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Namespace

Specifies the namespace that this cmdlet modifies. Namespaces provide a way to group and categorize notification hubs.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroup

Specifies the resource group to which the namespace is assigned. Resource groups organize items such as namespaces, notification hubs, and authorization rules in ways that help simply inventory management and Azure administration.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SkuTier

Sku tier of the namespace

Type:String
Position:4
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-State

Specifies the current state of the namespace. The acceptable values for this parameter are: Active and Disabled.

Type:NamespaceState
Accepted values:Unknown, Active, Disabled
Position:3
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Tag

Specifies name-value pairs that can be used to categorize and organize Azure items. Tags function similar to keywords, and operate across a deployment. For example, if you search for all items with the tag Department:IT the search will return all the Azure items that have that tag, regardless of such things as item type, location, or resource group. An individual tag consists of two parts: the Name and (optionally) the Value. For example, in Department:IT, the tag name is Department and the tag value is IT. To add a tag, use hash table syntax similar to this, which creates the tag CalendarYear:2016: -Tags @{Name="CalendarYear";Value="2016"} To add multiple tags in the same command, separate the individual tags by using commas: -Tag @{Name="CalendarYear";Value="2016"}, @{Name="FiscalYear";Value="2017"}

Type:Hashtable
Position:5
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

NamespaceState

Boolean

Hashtable

Outputs

NamespaceAttributes