Hi Wayne Bartkowski ,
I understand that you are seeing the "User was not found." error when running New-AzureADServicePrincipal
even though you are running the command with a global administrator account. There are a few reasons why this might be happening so here are some things to check:
- When you run
Connect-AzureAD
make sure that the successful confirmation displays and that the correct tenant and account are listed. - After you have connected, you can validate the connection by running
Get-AzureADDomain
. If you are connected to the correct domain where you have admin privileges, information about the domain will be displayed. Otherwise you will encounter the same "User was not found" error. - If you receive the error when running
Get-AzureADDomain
, you need to runConnect-AzureAD
again and make sure that the correct tenant ID is specified in the command. It's common for people to copy the tenant ID that is displayed when using Connect-AzureAd , but you need to make sure that the command is referencing the correct tenant under Azure Portal > Azure Active Directory > Overview > Tenant Id :PS C:\windows\system32> Connect-AzureAD -TenantId
Since these steps are not explicitly mentioned in the document you linked, it sounds plausible that the account is not connected to the correct tenant.
If you try these steps and still face the same error though, let me know and I can help troubleshoot and open a support case if needed.
_
If the information helped you, please Accept the answer. This will help us as well as others in the community who might be researching similar issues.