Skip to content

Commit 5f29c11

Browse files
committed
Clarifying setting spn and pw for ad domain join
1 parent 354b956 commit 5f29c11

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

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

Lines changed: 15 additions & 6 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: 05/24/2022
8+
ms.date: 07/14/2022
99
ms.author: kendownie
1010
ms.custom: devx-track-azurepowershell
1111
---
@@ -112,7 +112,7 @@ First, you must check the state of your environment. Specifically, you must chec
112112

113113
### Create an identity representing the storage account in your AD manually
114114

115-
To create this account manually, create a new Kerberos key for your storage account. Then, use that Kerberos key as the password for your account with the PowerShell cmdlets below. This key is only used during setup and cannot be used for any control or data plane operations against the storage account.
115+
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.
116116

117117
```PowerShell
118118
# 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
@@ -123,14 +123,23 @@ New-AzStorageAccountKey -ResourceGroupName $ResourceGroupName -Name $StorageAcco
123123
Get-AzStorageAccountKey -ResourceGroupName $ResourceGroupName -Name $StorageAccountName -ListKerbKey | where-object{$_.Keyname -contains "kerb1"}
124124
```
125125

126-
Once you have that key, create either a service or computer account under your OU. Use the following specification (remember to replace the example text with your storage account name):
126+
The cmdlets above should return the key value. Once you have the kerb1 key, create either a service account or computer account in AD under your OU, and use the key as the password for the AD identity.
127127

128-
SPN: "cifs/your-storage-account-name-here.file.core.windows.net"
129-
Password: Kerberos key for your storage account.
128+
1. Set the SPN to **cifs/your-storage-account-name-here.file.core.windows.net** either in the AD GUI or by running the `Setspn` command from the Windows command line as administrator (remember to replace the example text with your storage account name):
129+
130+
```shell
131+
Setspn -S cifs/your-storage-account-name-here.file.core.windows.net
132+
```
133+
134+
2. Use PowerShell to set the AD account password to the value of the kerb1 key (you must have AD PowerShell cmdlets installed):
135+
136+
```powershell
137+
Set-ADAccountPassword -Identity servername$ -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "kerb1_key_value_here" -Force)
138+
```
130139

131140
If your OU enforces password expiration, you must update the password before the maximum password age to prevent authentication failures when accessing Azure file shares. See [Update the password of your storage account identity in AD](storage-files-identity-ad-ds-update-password.md) for details.
132141

133-
Keep the SID of the newly created identity, you'll need it for the next step. The identity you've created that represent the storage account doesn't need to be synced to Azure AD.
142+
Keep the SID of the newly created identity, you'll need it for the next step. The identity you've created that represents the storage account doesn't need to be synced to Azure AD.
134143

135144
### Enable the feature on your storage account
136145

0 commit comments

Comments
 (0)