$resourceGroupName = "<resource-group>"
$storageAccountName = "<storage-account>"
# Get reference to storage account
$storageAccount = Get-AzStorageAccount `
-ResourceGroupName $resourceGroupName `
-StorageAccountName $storageAccountName
# If you've never enabled or disabled SMB Multichannel, the value for the SMB Multichannel
# property returned by Azure Files will be null. Null returned values should be interpreted
# as "default settings are in effect". To make this more user-friendly, the following
# PowerShell commands replace null values with the human-readable default values.
$defaultSmbMultichannelEnabled = $false
# Get the current value for SMB Multichannel
Get-AzStorageFileServiceProperty -StorageAccount $storageAccount | `
Select-Object -Property `
ResourceGroupName, `
StorageAccountName, `
@{
Name = "SmbMultichannelEnabled";
Expression = {
if ($null -eq $_.ProtocolSettings.Smb.Multichannel.Enabled) {
$defaultSmbMultichannelEnabled
} else {
$_.ProtocolSettings.Smb.Multichannel.Enabled
}
}
}
$resourceGroupName = "<resource-group>"
$storageAccountName = "<storage-account>"
# Get reference to storage account
$storageAccount = Get-AzStorageAccount `
-ResourceGroupName $resourceGroupName `
-StorageAccountName $storageAccountName
# If you've never changed any SMB security settings, the values for the SMB security
# settings returned by Azure Files will be null. Null returned values should be interpreted
# as "default settings are in effect". To make this more user-friendly, the following
# PowerShell commands replace null values with the human-readable default values.
# If you've deliberately set any of your SMB security settings to null, for example by
# disabling SMB channel encryption, comment out the following four lines to avoid
# changing the security settings back to defaults.
$smbProtocolVersions = "SMB2.1", "SMB3.0", "SMB3.1.1"
$smbAuthenticationMethods = "NTLMv2", "Kerberos"
$smbKerberosTicketEncryption = "RC4-HMAC", "AES-256"
$smbChannelEncryption = "AES-128-CCM", "AES-128-GCM", "AES-256-GCM"
# Gets the current values of the SMB security settings
Get-AzStorageFileServiceProperty -StorageAccount $storageAccount | `
Select-Object -Property `
ResourceGroupName, `
StorageAccountName, `
@{
Name = "SmbProtocolVersions";
Expression = {
if ($null -eq $_.ProtocolSettings.Smb.Versions) {
[String]::Join(", ", $smbProtocolVersions)
} else {
[String]::Join(", ", $_.ProtocolSettings.Smb.Versions)
}
}
},
@{
Name = "SmbChannelEncryption";
Expression = {
if ($null -eq $_.ProtocolSettings.Smb.ChannelEncryption) {
[String]::Join(", ", $smbChannelEncryption)
} else {
[String]::Join(", ", $_.ProtocolSettings.Smb.ChannelEncryption)
}
}
},
@{
Name = "SmbAuthenticationMethods";
Expression = {
if ($null -eq $_.ProtocolSettings.Smb.AuthenticationMethods) {
[String]::Join(", ", $smbAuthenticationMethods)
} else {
[String]::Join(", ", $_.ProtocolSettings.Smb.AuthenticationMethods)
}
}
},
@{
Name = "SmbKerberosTicketEncryption";
Expression = {
if ($null -eq $_.ProtocolSettings.Smb.KerberosTicketEncryption) {
[String]::Join(", ", $smbKerberosTicketEncryption)
} else {
[String]::Join(", ", $_.ProtocolSettings.Smb.KerberosTicketEncryption)
}
}
}