# Count the users involved in synchronization

## Overview

* If user wants to know the count of users being synchronized through <code class="expression">space.vars.SITENAME</code>, the 'UserCountUtility' utility can be used. This utility can count the following details of users whose data was synchronized from the first day of <code class="expression">space.vars.SITENAME</code> setup (or a specific date) till date.
  * Unique Users across all systems configured
  * Total Users across all systems configured
  * Total Users count per system
  * Detailed list for each of the users as per their availability in the systems configured
* The utility **UserCountUtility.zip** is by default bundled with <code class="expression">space.vars.SITENAME</code> installation and can be found at <code class="expression">space.vars.SITENAME</code>'s /Other\_Resources/Resources/UserCountUtility.zip.
* The utility can be executed only from the machine where <code class="expression">space.vars.SITENAME</code> is installed.
* The utility folder contains following files:
  * input.properties: To provide the input details required to run the utility.
  * UserCountUtility.bat: To run the utility if <code class="expression">space.vars.SITENAME</code> is installed on Windows machine.
  * UserCountUtility.sh: To run the utility if <code class="expression">space.vars.SITENAME</code> is installed on Linux machine.

## Input

The following inputs are to be provided in input.properties file:

* **Installation\_Path**
  * Provide the installation path of <code class="expression">space.vars.SITENAME</code>. For example, if <code class="expression">space.vars.SITENAME</code> is installed at `C:/Program Files/OpsHub`, then provide path as `C:/Program Files/OpsHub`.
* **Count\_Users\_From\_Date**
  * It is useful when the user wants the utility to count the users from a specific date. This is an optional input and the date should be in the format, `YYYY-MM-DD`. If left blank, utility will count all users. For example, if the user wants the utility to count users from 1 Jan. 2021, then the user can specify the date as `2021-01-01`. In that case, this utility will count the users from 1 Jan. 2021 till date.

Below is an example of input.properties file:

<div align="center"><img src="https://818964384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK5eA7qMDBFu0HHHMDehi%2Fuploads%2Fgit-blob-584666a9b4d7fc6e0073db6deb7c10afe6a1a649%2FUser_Count_Utility_1_a.png?alt=media" alt="" width="1000"></div>

## Steps to run Utility

Following are the steps to run the utility:

* Go to <code class="expression">space.vars.SITENAME</code>'s `<Installation Folder>/Other_Resources/Resources`.
* Unzip `UserCountUtility.zip`.
* Update the `input.properties` file as stated [here](#input).
* If your <code class="expression">space.vars.SITENAME</code> is installed on Windows machine, then refer to the steps given below:
  * Open Command Prompt
  * Navigate to <code class="expression">space.vars.SITENAME</code> `<Installation Folder>/Other_Resources/Resources` path
  * Execute the bat using command `UserCountUtility.bat` as shown below:

<div align="center"><img src="https://818964384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK5eA7qMDBFu0HHHMDehi%2Fuploads%2Fgit-blob-9875a2862458dc880293a2a0e0121b3a9d2d4a81%2FUser_Count_Utility_5_a.png?alt=media" alt="" width="1100"></div>

{% if "OpsHub Integration Manager" === space.vars.SITENAME %}

* If your <code class="expression">space.vars.SITENAME</code> is installed on Linux machine, then refer to the steps given below:
  * Open Shell Script
  * Navigate to <code class="expression">space.vars.SITENAME</code>'s `<Installation Folder>/Other_Resources/Resources` path
  * Execute the bat using command `sh UserCountUtility.sh` as shown below:

<div align="center"><img src="https://818964384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK5eA7qMDBFu0HHHMDehi%2Fuploads%2Fgit-blob-d5e28e4299b481abbeb4329d4952b32e3b04b8a8%2FUser_Count_Utility_6_a.png?alt=media" alt="" width="1000"></div>
{% endif %}

Once the execution is completed, the user will see the output similar to the details given in the screenshot (an example of execution on Windows machine) below:

<div align="center"><img src="https://818964384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK5eA7qMDBFu0HHHMDehi%2Fuploads%2Fgit-blob-d75b041f3502a97350f351943747ff0c265fabdb%2FUser_Count_Utility_2_a.png?alt=media" alt="" width="1000"></div>

## Output

Once the utility execution starts, it creates a folder `output` which contains below files for the user count reports and utility execution logs:

1. **UserCountSummary.csv**: It contains count of unique users across all systems configured, total users count across all systems configured and total users count per system. For more information, refer to [UserCountSummary](#usercountsummarycsv) section.
2. **UserCountDetailedReport.csv**: It contains detailed list for each users as per their availability in the systems configured. For more information, refer to [UserCountDetailedReport](#usercountdetailedreportcsv) section.
3. **logs.log**: It contains the details of the utility execution.

### UserCountSummary.csv

This file contains the following details:

* **Total Unique**
  * It represents the number of unique users present in the synchronization done so far across all the systems configured. For example, if the user is present in

    . There is a user (with email: `demouser@test.com`) who is present in both

    , then, the user will be considered unique. For the users with no specified emails, in that case, their usernames will be considered unique.
* **Total**
  * It represents the total number of users in all the systems.
* **Distribution of users per system**
  * It has the list of systems and the number of users synchronized by <code class="expression">space.vars.SITENAME</code>.

{% if "OpsHub Migrator for Microsoft Azure DevOps" === space.vars.SITENAME %}

<div align="center"><img src="https://818964384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK5eA7qMDBFu0HHHMDehi%2Fuploads%2Fgit-blob-57b7ce42eed4b48d472df4ceed9edff7653b7d3e%2FUser_Count_Utility_3_a_ovsmu.png?alt=media" alt=""></div>
{% endif %}

{% if "OpsHub Integration Manager" === space.vars.SITENAME %}

<div align="center"><img src="https://818964384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK5eA7qMDBFu0HHHMDehi%2Fuploads%2Fgit-blob-41152f325c7eb52c2d5c70a1b09d9a7673580fab%2FUser_Count_Utility_3_a.png?alt=media" alt="" width="1000"></div>
{% endif %}

### UserCountDetailedReport.csv

* It has a detailed report on the users found during synchronization.
* It has the user details (User Email or User Name as per the details found during synchronization). Additionally, a corresponding list of systems is present in which the users' details are found.

{% if "OpsHub Migrator for Microsoft Azure DevOps" === space.vars.SITENAME %}

<div align="center"><img src="https://818964384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK5eA7qMDBFu0HHHMDehi%2Fuploads%2Fgit-blob-9b22acc01b4051444cf86e4050d6b47cf196f582%2FUser_Count_Utility_4_a_ovsmu.png?alt=media" alt=""></div>
{% endif %}

{% if "OpsHub Integration Manager" === space.vars.SITENAME %}

<div align="center"><img src="https://818964384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK5eA7qMDBFu0HHHMDehi%2Fuploads%2Fgit-blob-b3012fd6af7b65fcde54b00261d1c948ec567896%2FUser_Count_Utility_4_a.png?alt=media" alt="" width="1000"></div>
{% endif %}
