Collect user count with PowerShell

Calculate your Docentric CE effective user count from your own PC using a PowerShell script, without opening Docentric CE. The script reads the same user and license data as the Collect user count action on the License page, so you get the same result. Use it when you'd rather run the check outside Dynamics 365.

Prerequisites

  • A Windows PC with PowerShell. Windows PowerShell, included with Windows or PowerShell 7, is also supported.
  • A Microsoft Entra ID account with the Global Reader or Global Administrator role, or an equivalent role that grants read access to users and licenses (User.Read.All or User.ReadBasic.All, and LicenseAssignment.Read.All or Directory.Read.All).
  • The Az.Accounts PowerShell module. Install it in the next section, or let the script install it for you.
NOTE

Download the Get-DocentricCEEffectiveUserCount.ps1 script from the Docentric CE website.

Install the sign-in module (Az.Accounts)

Install the module the script uses to sign you in. You only do this once per computer.

  1. Open PowerShell.
  2. Run Install-Module Az.Accounts -Scope CurrentUser.
  3. If PowerShell asks to trust the PSGallery repository, select Yes.

If you'd rather have the script install the module for you, skip this step and add the -InstallDependencies switch when you run the script. Confirm the prompt when it asks to install Az.Accounts.

Download and run the script

  1. Download Get-DocentricCEEffectiveUserCount.ps1 from the Docentric CE website and save it to a folder, for example C:\Docentric.
  2. Open PowerShell and go to that folder: cd C:\Docentric.
  3. Run the script: .\Get-DocentricCEEffectiveUserCount.ps1.
  4. In the sign-in window that opens, sign in with your work account. Don't use a personal Microsoft account.
  5. Wait while the script reads users and licenses from your tenant and builds the report. A progress bar shows the status, and the effective user count appears on screen when the run finishes.

Customize the report

Add any of these switches after the script name to change what it does:

  • -Csv: Also write the per-user license rows to an Excel-friendly CSV file.
  • -IncludePerUserLicenseDetails: Add the per-user license rows to the JSON report too.
  • -HasDocentricAxLicense: Add this only if your organization also holds a Docentric AX license. It changes how certain Finance and Operations users are counted.
  • -TenantId <tenant>: Sign in to a specific tenant when your account belongs to more than one.
  • -OutputDirectory <path>: Save the report files to a folder other than the one you ran the script from.
  • -MaxParallelRequests <number>: Fetch fewer or more users at once (1 to 32, default 10). Lower this if Microsoft Graph throttles the requests.

Review the results

The script always creates a JSON report named LicenseCountReport_<tenantid>_<date-time>.json with your effective user count, a per-category breakdown, and the tenant ID. If it can't read every user's licenses, it stops and creates no files, so any report you get is always complete.

Send the JSON file to sales when requesting a quote or renewing your production license. It contains everything needed to verify your licensing. You don't need to send the CSV file.

Next step

Configure license