Skip to content

Commit d37bace

Browse files
committed
updating script with servicelogon warning
1 parent 5f57690 commit d37bace

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

articles/storage/files/storage-files-identity-ad-ds-enable.md

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: khdownie
55
ms.service: storage
66
ms.subservice: files
77
ms.topic: how-to
8-
ms.date: 07/14/2022
8+
ms.date: 07/29/2022
99
ms.author: kendownie
1010
ms.custom: devx-track-azurepowershell
1111
---
@@ -59,33 +59,43 @@ Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
5959
# Import AzFilesHybrid module
6060
Import-Module -Name AzFilesHybrid
6161
62-
# Login with an Azure AD credential that has either storage account owner or contributor Azure role assignment
63-
# If you are logging into an Azure environment other than Public (ex. AzureUSGovernment) you will need to specify that.
62+
# Login with an Azure AD credential that has either storage account owner or contributor Azure role
63+
# assignment. If you are logging into an Azure environment other than Public (ex. AzureUSGovernment)
64+
# you will need to specify that.
6465
# See https://docs.microsoft.com/azure/azure-government/documentation-government-get-started-connect-with-ps
6566
# for more information.
6667
Connect-AzAccount
6768
6869
# Define parameters
6970
# $StorageAccountName is the name of an existing storage account that you want to join to AD
70-
# $SamAccountName is the name of the to-be-created AD object, which is used by AD as the logon name for the object. See https://docs.microsoft.com/en-us/windows/win32/adschema/a-samaccountname
71-
# for more information.
71+
# $SamAccountName is the name of the to-be-created AD object, which is used by AD as the logon name
72+
# for the object.
73+
# See https://docs.microsoft.com/en-us/windows/win32/adschema/a-samaccountname for more information.
7274
$SubscriptionId = "<your-subscription-id-here>"
7375
$ResourceGroupName = "<resource-group-name-here>"
7476
$StorageAccountName = "<storage-account-name-here>"
7577
$SamAccountName = "<sam-account-name-here>"
7678
$DomainAccountType = "<ComputerAccount|ServiceLogonAccount>" # Default is set as ComputerAccount
77-
# If you don't provide the OU name as an input parameter, the AD identity that represents the storage account is created under the root directory.
79+
# ServiceLogonAccount does not support AES256 encryption.
80+
# If you don't provide the OU name as an input parameter, the AD identity that represents the
81+
# storage account is created under the root directory.
7882
$OuDistinguishedName = "<ou-distinguishedname-here>"
7983
# Specify the encryption algorithm used for Kerberos authentication. Using AES256 is recommended.
8084
$EncryptionType = "<AES256|RC4|AES256,RC4>"
8185
8286
# Select the target subscription for the current session
8387
Select-AzSubscription -SubscriptionId $SubscriptionId
8488
85-
# Register the target storage account with your active directory environment under the target OU (for example: specify the OU with Name as "UserAccounts" or DistinguishedName as "OU=UserAccounts,DC=CONTOSO,DC=COM").
86-
# You can use to this PowerShell cmdlet: Get-ADOrganizationalUnit to find the Name and DistinguishedName of your target OU. If you are using the OU Name, specify it with -OrganizationalUnitName as shown below. If you are using the OU DistinguishedName, you can set it with -OrganizationalUnitDistinguishedName. You can choose to provide one of the two names to specify the target OU.
87-
# You can choose to create the identity that represents the storage account as either a Service Logon Account or Computer Account (default parameter value), depends on the AD permission you have and preference.
88-
# Run Get-Help Join-AzStorageAccountForAuth for more details on this cmdlet.
89+
# Register the target storage account with your active directory environment under the target OU
90+
# (for example: specify the OU with Name as "UserAccounts" or DistinguishedName as
91+
# "OU=UserAccounts,DC=CONTOSO,DC=COM"). You can use this PowerShell cmdlet: Get-ADOrganizationalUnit
92+
# to find the Name and DistinguishedName of your target OU. If you are using the OU Name, specify it
93+
# with -OrganizationalUnitName as shown below. If you are using the OU DistinguishedName, you can set it
94+
# with -OrganizationalUnitDistinguishedName. You can choose to provide one of the two names to specify
95+
# the target OU. You can choose to create the identity that represents the storage account as either a
96+
# Service Logon Account or Computer Account (default parameter value), depending on your AD permissions
97+
# and preference. Run Get-Help Join-AzStorageAccountForAuth for more details on this cmdlet. Note that
98+
# Service Logon Accounts do not support AES256 encryption.
8999
90100
Join-AzStorageAccount `
91101
-ResourceGroupName $ResourceGroupName `
@@ -95,10 +105,14 @@ Join-AzStorageAccount `
95105
-OrganizationalUnitDistinguishedName $OuDistinguishedName `
96106
-EncryptionType $EncryptionType
97107
98-
#Run the command below to enable AES256 encryption. If you plan to use RC4, you can skip this step.
108+
# Run the command below to enable AES256 encryption. If you plan to use RC4, you can skip this step.
109+
# Note that if you set $DomainAccountType to ServiceLogonAccount, running this command will change
110+
# the account type to ComputerAccount because ServiceLogonAccount doesn't support AES256.
99111
Update-AzStorageAccountAuthForAES256 -ResourceGroupName $ResourceGroupName -StorageAccountName $StorageAccountName
100112
101-
#You can run the Debug-AzStorageAccountAuth cmdlet to conduct a set of basic checks on your AD configuration with the logged on AD user. This cmdlet is supported on AzFilesHybrid v0.1.2+ version. For more details on the checks performed in this cmdlet, see Azure Files Windows troubleshooting guide.
113+
# You can run the Debug-AzStorageAccountAuth cmdlet to conduct a set of basic checks on your AD configuration
114+
# with the logged on AD user. This cmdlet is supported on AzFilesHybrid v0.1.2+ version. For more details on
115+
# the checks performed in this cmdlet, see Azure Files Windows troubleshooting guide.
102116
Debug-AzStorageAccountAuth -StorageAccountName $StorageAccountName -ResourceGroupName $ResourceGroupName -Verbose
103117
```
104118

@@ -115,7 +129,8 @@ First, you must check the state of your environment. Specifically, you must chec
115129
To create this account manually, first create a new Kerberos key for your storage account and get the access key using the PowerShell cmdlets below. This key is only used during setup. It can't be used for any control or data plane operations against the storage account.
116130

117131
```PowerShell
118-
# Create the Kerberos key on the storage account and get the Kerb1 key as the password for the AD identity to represent the storage account
132+
# Create the Kerberos key on the storage account and get the Kerb1 key as the password for the AD identity
133+
# to represent the storage account
119134
$ResourceGroupName = "<resource-group-name-here>"
120135
$StorageAccountName = "<storage-account-name-here>"
121136

0 commit comments

Comments
 (0)