Editar

Partilhar via


Update-AzStorageFileServiceProperty

Modifies the service properties for the Azure Storage File service.

Syntax

Update-AzStorageFileServiceProperty
      [-ResourceGroupName] <String>
      [-StorageAccountName] <String>
      [-EnableShareDeleteRetentionPolicy <Boolean>]
      [-ShareRetentionDays <Int32>]
      [-EnableSmbMultichannel <Boolean>]
      [-SmbProtocolVersion <String[]>]
      [-SmbAuthenticationMethod <String[]>]
      [-SmbChannelEncryption <String[]>]
      [-SmbKerberosTicketEncryption <String[]>]
      [-CorsRule <PSCorsRule[]>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzStorageFileServiceProperty
      -StorageAccount <PSStorageAccount>
      [-EnableShareDeleteRetentionPolicy <Boolean>]
      [-ShareRetentionDays <Int32>]
      [-EnableSmbMultichannel <Boolean>]
      [-SmbProtocolVersion <String[]>]
      [-SmbAuthenticationMethod <String[]>]
      [-SmbChannelEncryption <String[]>]
      [-SmbKerberosTicketEncryption <String[]>]
      [-CorsRule <PSCorsRule[]>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzStorageFileServiceProperty
      [-ResourceId] <String>
      [-EnableShareDeleteRetentionPolicy <Boolean>]
      [-ShareRetentionDays <Int32>]
      [-EnableSmbMultichannel <Boolean>]
      [-SmbProtocolVersion <String[]>]
      [-SmbAuthenticationMethod <String[]>]
      [-SmbChannelEncryption <String[]>]
      [-SmbKerberosTicketEncryption <String[]>]
      [-CorsRule <PSCorsRule[]>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Update-AzStorageFileServiceProperty cmdlet modifies the service properties for the Azure Storage File service.

Examples

Example 1: Enable File share softdelete

Update-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EnableShareDeleteRetentionPolicy $true -ShareRetentionDays 5

StorageAccountName                            : mystorageaccount
ResourceGroupName                             : myresourcegroup
ShareDeleteRetentionPolicy.Enabled            : True
ShareDeleteRetentionPolicy.Days               : 5
ProtocolSettings.Smb.Multichannel.Enabled     : False
ProtocolSettings.Smb.Versions                 : 
ProtocolSettings.Smb.AuthenticationMethods    : 
ProtocolSettings.Smb.KerberosTicketEncryption : 
ProtocolSettings.Smb.ChannelEncryption        :

This command enables File share softdelete delete with retention days as 5

Example 2: Enable Smb Multichannel

Update-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EnableSmbMultichannel $true

StorageAccountName                            : mystorageaccount
ResourceGroupName                             : myresourcegroup
ShareDeleteRetentionPolicy.Enabled            : True
ShareDeleteRetentionPolicy.Days               : 5
ProtocolSettings.Smb.Multichannel.Enabled     : True
ProtocolSettings.Smb.Versions                 : 
ProtocolSettings.Smb.AuthenticationMethods    : 
ProtocolSettings.Smb.KerberosTicketEncryption : 
ProtocolSettings.Smb.ChannelEncryption        :

This command enables Smb Multichannel, only supported on Premium FileStorage account.

Example 3: Updates secure smb settings

Update-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" `
			-SMBProtocolVersion SMB2.1,SMB3.0,SMB3.1.1  `
			-SMBAuthenticationMethod Kerberos,NTLMv2 `
			-SMBKerberosTicketEncryption RC4-HMAC,AES-256 `
			-SMBChannelEncryption AES-128-CCM,AES-128-GCM,AES-256-GCM

StorageAccountName                            : mystorageaccount
ResourceGroupName                             : myresourcegroup
ShareDeleteRetentionPolicy.Enabled            : True
ShareDeleteRetentionPolicy.Days               : 5
ProtocolSettings.Smb.Multichannel.Enabled     : True
ProtocolSettings.Smb.Versions                 : {SMB2.1, SMB3.0, SMB3.1.1}
ProtocolSettings.Smb.AuthenticationMethods    : {Kerberos, NTLMv2}
ProtocolSettings.Smb.KerberosTicketEncryption : {RC4-HMAC, AES-256}
ProtocolSettings.Smb.ChannelEncryption        : {AES-128-CCM, AES-128-GCM, AES-256-GCM}

This command updates secure smb settings.

Example 4: Clear secure smb settings

Update-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" `
			-SMBProtocolVersion @() `
			-SMBAuthenticationMethod @() `
			-SMBKerberosTicketEncryption @() `
			-SMBChannelEncryption @()

StorageAccountName                            : mystorageaccount
ResourceGroupName                             : myresourcegroup
ShareDeleteRetentionPolicy.Enabled            : True
ShareDeleteRetentionPolicy.Days               : 5
ProtocolSettings.Smb.Multichannel.Enabled     : True
ProtocolSettings.Smb.Versions                 : 
ProtocolSettings.Smb.AuthenticationMethods    : 
ProtocolSettings.Smb.KerberosTicketEncryption : 
ProtocolSettings.Smb.ChannelEncryption        :

This command clears secure smb settings.

Example 5: Update CORS rules

$CorsRules = (@{
    AllowedHeaders=@("x-ms-blob-content-type","x-ms-blob-content-disposition");
    ExposedHeaders=@(); 
    AllowedOrigins=@("*");
    AllowedMethods=@("TRACE","CONNECT")},
    @{
    AllowedOrigins=@("http://www.fabrikam.com","http://www.contoso.com"); 
    ExposedHeaders=@("x-ms-meta-data*","x-ms-meta-customheader"); 
    AllowedHeaders=@("x-ms-meta-target*","x-ms-meta-customheader");
    MaxAgeInSeconds=30;
    AllowedMethods=@("PUT")})

$property = Update-AzStorageFileServiceProperty -ResourceGroupName myresourcegroup -StorageAccountName mystorageaccount -CorsRule $CorsRules
$property.Cors.CorsRulesProperty

AllowedOrigins  : {*}
AllowedMethods  : {TRACE, CONNECT}
MaxAgeInSeconds : 0
ExposedHeaders  : {}
AllowedHeaders  : {x-ms-blob-content-type, x-ms-blob-content-disposition}

AllowedOrigins  : {http://www.fabrikam.com, http://www.contoso.com}
AllowedMethods  : {PUT}
MaxAgeInSeconds : 30
ExposedHeaders  : {x-ms-meta-customheader, x-ms-meta-data*}
AllowedHeaders  : {x-ms-meta-customheader, x-ms-meta-target*}

The first command assigns an array of rules to the $CorsRules variable. This command uses standard extends over several lines in this code block. The second command sets the rules in $CorsRules to the File service of a Storage account.

Example 6: Clean up CORS rules

Update-AzStorageFileServiceProperty -ResourceGroupName myresourcegroup -StorageAccountName mystorageaccount -CorsRule @()

This command cleans up the CORS rules of a Storage account by inputting @() to parameter CorsRule.

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

-CorsRule

Specifies CORS rules for the File service.

Type:PSCorsRule[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
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

-EnableShareDeleteRetentionPolicy

Enable share Delete Retention Policy for the storage account by set to $true, disable share Delete Retention Policy by set to $false.

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

-EnableSmbMultichannel

Enable Multichannel by set to $true, disable Multichannel by set to $false. Applies to Premium FileStorage only.

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

-ResourceGroupName

Resource Group Name.

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

-ResourceId

Input a Storage account Resource Id, or a File service properties Resource Id.

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

-ShareRetentionDays

Sets the number of retention days for the share DeleteRetentionPolicy. The value should only be set when enable share Delete Retention Policy.

Type:Int32
Aliases:Days, RetentionDays
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SmbAuthenticationMethod

Gets or sets SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos.

Type:String[]
Accepted values:Kerberos, NTLMv2
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SmbChannelEncryption

Gets or sets SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM.

Type:String[]
Accepted values:AES-128-CCM, AES-128-GCM, AES-256-GCM
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SmbKerberosTicketEncryption

Gets or sets kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256.

Type:String[]
Accepted values:AES-256, RC4-HMAC
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SmbProtocolVersion

Gets or sets SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1.

Type:String[]
Accepted values:SMB2.1, SMB3.0, SMB3.1.1
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StorageAccount

Storage account object

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

-StorageAccountName

Storage Account Name.

Type:String
Aliases:AccountName, Name
Position:1
Default value:None
Required:True
Accept pipeline input:False
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

PSStorageAccount

String

Outputs

PSFileServiceProperties