If the parent domain is federated, you need to use the New-MSOLFederatedDomain cmdlet as detailed here: https://learn.microsoft.com/en-us/troubleshoot/azure/active-directory/new-msoldomain-cmdle-add-subdomain
Adding custom subdomin in Azure AD
ARUN ANAND
1
Reputation point
Good Morning All,
I have already added a Domain "test.com" in Azure AD under custom domain and got it Federated with on-premise ADFS 2012.
The command I used for Federation in ADFS was "convert-msoldomaintofederated -domainname "test.com" -supportmultipledomain
Now I am trying to add the subdomain "Sample.test.com" in the Custom Domain name in Azure AD and getting below error:
Failed to add Domain
One or more properties contains invalid values
Could you please help