Azure-Samples / Azure-Samples/azure-files-samples
Get-AzStorageAccountADObject : AD object is of unsupported object class domainDNS computer.
- Dominant language
- PowerShell
- Stars
- 261
- Forks
- 202
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 4
Description
I've rattled my head trying to figure out what is causing this error, as I've done this quite a few times. I initially thought it was Windows Server 2022 but regressed versions and even attempted to change Az module versions. then I tried a few different versions of the AzFilesHybrid module. It keeps producing this error. At best after digging around trying to make it work:
Get-AzStorageAccountADObject : AD object is of unsupported object class domainDNS computer.
At C:\Users\\Documents\WindowsPowerShell\Modules\AzFilesHybrid\0.2.4.0\AzFilesHybrid.psm1:3545 char:33
$azureStorageIdentity = Get-AzStorageAccountADObject
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-AzStorageAccountADObject
I got to a point where, I tested the function that the error seems to come from...
Get-AzStorageAccountActiveDirectoryProperties : ActiveDirectoryProperties is not set for storage account
'storageacct' in resource group 'production'. To set the properties, please use cmdlet
Set-AzStorageAccount if the account is already associated with an Active Directory, or use cmdlet
Join-AzStorageAccountForAuth to join the account to an Active Directory
(https://docs.microsoft.com/en-us/azure/storage/files/storage-files-identity-ad-ds-enable)
At C:\Users\user\Documents\WindowsPowerShell\Modules\AzFilesHybrid\0.2.4.0\AzFilesHybrid.psm1:2678 char:46
... DirectoryProperties = Get-AzStorageAccountActiveDirectoryProperties
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-AzStorageAccountActiveDirectoryPro
perties
I'm not entirely sure what's triggering the errors. It does manage to create the computeraccount or service principle but everytime it fails to do something. I am following instructions as-per https://docs.microsoft.com/en-us/azure/storage/files/storage-files-identity-ad-ds-enable#run-join-azstorageaccount
Contributor guide
Research direction
Reproduce the failure using the documented Join-AzStorageAccountForAuth flow, then inspect AzFilesHybrid.psm1 around lines 2678 and 3545 and the Get-AzStorageAccountActiveDirectoryProperties and Get-AzStorageAccountADObject calls. Compare the reported AD object class and storage account properties with the Azure Files identity AD DS instructions; the issue is done when the triggering configuration or a confirmed module defect is identified and the join completes without these errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- authentication, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100