Skip to content

Commit 3a682e8

Browse files
Merge pull request #312538 from khdownie/kendownie030326
Files AD DS auth integrity check
2 parents 5d707a1 + dfc6770 commit 3a682e8

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to enable Active Directory Domain Services authentication
44
author: khdownie
55
ms.service: azure-file-storage
66
ms.topic: how-to
7-
ms.date: 02/23/2026
7+
ms.date: 03/03/2026
88
ms.author: kendownie
99
ms.custom: devx-track-azurepowershell
1010
# Customer intent: As an IT administrator, I want to enable Active Directory Domain Services authentication for Azure file shares, so that our domain-joined Windows virtual machines can securely access and manage file shares using existing AD credentials.
@@ -31,16 +31,16 @@ The AzFilesHybrid PowerShell module provides cmdlets for deploying and configuri
3131
### Prerequisites
3232

3333
- Install [.NET Framework 4.7.2 or higher](https://dotnet.microsoft.com/download/dotnet-framework/) if it's not already installed. The AzFilesHybrid module requires it to import successfully.
34-
- Make sure you have [Azure PowerShell](/powershell/azure/install-azure-powershell) (Az module) and [Az.Storage](https://www.powershellgallery.com/packages/Az.Storage/) installed. You must have at least Az.PowerShell 2.8.0+ and Az.Storage 4.3.0+ to use AzFilesHybrid.
34+
- Make sure you have the latest versions of [Azure PowerShell](/powershell/azure/install-azure-powershell) (Az module) and [Az.Storage](https://www.powershellgallery.com/packages/Az.Storage/) installed. You must have Az.Storage 8.1.0 or higher to use AzFilesHybrid.
3535
- Install the [Active Directory PowerShell](/powershell/module/activedirectory/) module.
3636

3737
### Download AzFilesHybrid module
3838

39-
[Download and unzip the latest version of the AzFilesHybrid module](https://github.com/Azure-Samples/azure-files-samples/releases).
39+
Download and unzip the latest version of the [AzFilesHybrid module](https://www.powershellgallery.com/packages/AzFilesHybrid/).
4040

4141
### Run Join-AzStorageAccount
4242

43-
The `Join-AzStorageAccount` cmdlet performs the equivalent of an offline domain join for the specified storage account. The following script uses this cmdlet to create a [computer account](/windows/security/identity-protection/access-control/active-directory-accounts#manage-default-local-accounts-in-active-directory) in your AD domain. If you can't use a computer account, you can change the script to create a [service logon account](/windows/win32/ad/about-service-logon-accounts) instead. Starting with AzFilesHybrid version 0.2.5, using AES-256 encryption with service logon accounts is supported.
43+
The `Join-AzStorageAccount` cmdlet performs the equivalent of an offline domain join for the specified storage account. The following script uses this cmdlet to create a [computer account](/windows/security/identity-protection/access-control/active-directory-accounts#manage-default-local-accounts-in-active-directory) in your AD domain. If you can't use a computer account, you can change the script to create a [service logon account](/windows/win32/ad/about-service-logon-accounts) instead. Using AES-256 encryption with service logon accounts is supported starting with AzFilesHybrid version 0.2.5.
4444

4545
The AD DS account that the cmdlet creates represents the storage account. If you create the AD DS account under an organizational unit (OU) that enforces password expiration, you must update the password before the maximum password age. If you don't update the account password before that date, authentication fails when accessing Azure file shares. For more information on how to update the password, see [Update AD DS account password](storage-files-identity-ad-ds-update-password.md).
4646

@@ -129,7 +129,7 @@ Most customers should choose [Option one](#option-one-recommended-use-azfileshyb
129129
First, check the state of your environment.
130130

131131
- Check if [Active Directory PowerShell](/powershell/module/activedirectory/) is installed, and if the shell is running with administrator privileges.
132-
- Make sure the [Az.Storage module](https://www.powershellgallery.com/packages/Az.Storage/) is installed, and install it if it isn't. You need at least version 2.0.
132+
- Make sure the latest version of the [Az.Storage module](https://www.powershellgallery.com/packages/Az.Storage/) is installed, and install it if it isn't.
133133
- After completing those checks, check your AD DS to see if there's either a [computer account](/windows/security/identity-protection/access-control/active-directory-accounts#manage-default-local-accounts-in-active-directory) (default) or [service logon account](/windows/win32/ad/about-service-logon-accounts) that you created with SPN/UPN such as "cifs/your-storage-account-name-here.file.core.windows.net". If the account doesn't exist, create one as described in the following section.
134134

135135
> [!IMPORTANT]
@@ -151,7 +151,7 @@ Get-AzStorageAccountKey -ResourceGroupName $ResourceGroupName -Name $StorageAcco
151151

152152
The cmdlets return the key value. Once you have the kerb1 key, create either a [computer account](/powershell/module/activedirectory/new-adcomputer) or [service account](/powershell/module/activedirectory/new-adserviceaccount) in AD under your OU, and use the key as the password for the AD identity.
153153

154-
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 (replace the example text with your storage account name and `<ADAccountName>` with your AD account name).
154+
1. Set the SPN to **cifs/your-storage-account-name-here.file.core.windows.net** either in the Active Directory GUI or by running the `Setspn` command from the Windows command line as administrator (replace the example text with your storage account name and `<ADAccountName>` with your AD account name).
155155

156156
```shell
157157
Setspn -S cifs/your-storage-account-name-here.file.core.windows.net <ADAccountName>
@@ -182,8 +182,7 @@ Keep the SID of the newly created identity, you'll need it for the next step. Th
182182

183183
### Enable the feature on your storage account
184184

185-
Modify the following command to include configuration details for the domain properties, then run it to enable the feature. The storage account SID required in the following command is the SID of the identity you created in your AD DS in [the previous section](#create-an-identity-representing-the-storage-account-in-your-ad-manually). Make sure that you provide the **ActiveDirectorySamAccountName** property without the trailing '
186-
sign.
185+
Modify the following command to include configuration details for the domain properties, then run it to enable the feature. The storage account SID required in the following command is the SID of the identity you created in your AD DS in [the previous section](#create-an-identity-representing-the-storage-account-in-your-ad-manually). Make sure that you provide the **ActiveDirectorySamAccountName** property without the trailing '$' sign.
187186

188187
```PowerShell
189188
# Set the feature flag on the target storage account and provide the required AD domain information
@@ -195,7 +194,7 @@ Set-AzStorageAccount `
195194
-ActiveDirectoryNetBiosDomainName "<your-domain-dns-root>" `
196195
-ActiveDirectoryForestName "<your-forest-name>" `
197196
-ActiveDirectoryDomainGuid "<your-guid>" `
198-
-ActiveDirectoryDomainsid "<your-domain-sid>" `
197+
-ActiveDirectoryDomainSid "<your-domain-sid>" `
199198
-ActiveDirectoryAzureStorageSid "<your-storage-account-sid>" `
200199
-ActiveDirectorySamAccountName "<your-domain-object-sam-account-name>" `
201200
-ActiveDirectoryAccountType "<your-domain-object-account-type, the value could be 'Computer' or 'User'>"
@@ -246,13 +245,13 @@ Debug-AzStorageAccountAuth -StorageAccountName $StorageAccountName -ResourceGrou
246245

247246
## Confirm the feature is enabled
248247

249-
Check if Active Directory is enabled on your storage account by using the following script:
248+
Check if AD DS is enabled on your storage account by using the following script. Replace `<resource-group-name>` and `<storage-account-name>` with your values.
250249

251250
```PowerShell
252251
# Get the target storage account
253252
$storageaccount = Get-AzStorageAccount `
254-
-ResourceGroupName "<your-resource-group-name-here>" `
255-
-Name "<your-storage-account-name-here>"
253+
-ResourceGroupName "<resource-group-name>" `
254+
-Name "<storage-account-name>"
256255
257256
# List the directory service of the selected service account
258257
$storageAccount.AzureFilesIdentityBasedAuth.DirectoryServiceOptions

0 commit comments

Comments
 (0)