Contents

Admin provisioning tools in Dynamics 365 Finance Operations

After restoring database backup, you want to be able to login to Dynamics 365 Finance Operations with different ternant, you need to use the admin provisioning tool to assign a new tenant.

Before 10.0.23 verison

The admin provisioning tool can be found at

VHD: C:\AOSService\PackagesLocalDirectory\bin\AdminUserProvisioning.exe

Cloud- hosted: K:\AOSService\PackagesLocalDirectory\bin\AdminUserProvisioning.exe

After running Provisioning.exe wtih admin right, you will see the update for the admin user in SQL.

/2022-09-18-admin-provisioning-tools/userinfo.png
userinfo

Some errors you might face:

Failure
Can not stop the DynamicsAXBatch service on computer
Failure
Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Failure
The remote server returned an error: (500) Internal Server Error.

Resolution, you can simply stop and start the services manually:

  • World Wide Web Publishing Service
  • Microsoft Dynamics 365 Unified Operations: Batch Management Service

Or you can restart VM using LCS or Azure portal.

If the issue Can not stop the DynamicsAXBatch service on computer still persist

You can kill the batch service using cmd:

  1. Open CMD
  2. sc queryex DynamicsAxBatch
  3. taskkill /f /pid 8064

/2022-09-18-admin-provisioning-tools/queryex.png
queryex

There is another error about Database

Failure
Cannot open database “AxDB” requested by the login. The login failed. Login failed for user ‘axdbadmin’.

Please this post for getting VHD Database password.

From 10.0.23

From 10.0.23, the Admin user provisioning tool is removed due to security reasons, the reply URL setup for AAD was changed. It is typically used to change the tenant of the environment. You can update the sign in information in the database for the Admin user or any other user. You only need the SID and network alias (email address) from a user that can access the environment or another environment on the same tenant.

To get the SID:

1
wmic useraccount get name,sid

/2022-09-18-admin-provisioning-tools/get-sid-cmd.png
get-sid-cmd

Once you have admin SID, you can update the tenant in SQL by using.

1
2
3
select ID, SID, NETWORKALIAS from USERINFO where ID = 'Admin'

update USERINFO set SID = 'new_SID', NETWORKALIAS = 'new_NetworkAlias' where ID = 'Admin'

You might also got error

Failure
AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: ‘00000015-0000-0000-c000-000000000000’

Go to C:\AOSService\webroot\web.config, get Aad.Realm, Aad.TenantDomainGUID, Infrastructure.HostUrl

Run below script to add Dynamics 365 URL to ERP service principle application

/2022-09-18-admin-provisioning-tools/00000015-0000-0000-c000-000000000000.png
00000015-0000-0000-c000-000000000000

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
$AADTenant = "xxxxxx-843a-434c-ae23-f8614106ac37"
$EnvironmentUrl = "https://xxxxxxxx.axcloud.dynamics.com"
$AADRealm = "00000015-0000-0000-c000-000000000000"

Connect-AzureAD

# Get Service Principal details
$SP = Get-AzureADServicePrincipal -Filter "AppId eq '$AADRealm'"

#Add Reply URLs
$SP.ReplyUrls.Add("$EnvironmentUrl")
$SP.ReplyUrls.Add("$EnvironmentUrl/oauth")

#Set/Update Reply URL
Set-AzureADServicePrincipal -ObjectId $SP.ObjectId -ReplyUrls $SP.ReplyUrls

If you are running VHD for the first time, please do this task