> ## Documentation Index
> Fetch the complete documentation index at: https://docs.idemeum.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Immy bot

> Unified idemeum agent deployment with Immy.bot.

With Immy there are two integration types that we support:

* `Manual` - with this integration you can simply grab the idemeum unified deployment script, create a deployment package, and push to your customers in Immy. With this integration there is no need to create customer tenants in idemeum, as they will be created automatically leveraging the `$TenantName` variable in Immy.
* `Catalog` - with this integration you can leverage integration catalog in Immy in select pre-configured idemeum integration. With this integration you will need to create customers in idemeum before hand, so that they can be mapped in Immy.

## Manual integration

With this integration idemeum customer tenants will be auto created - grab the unified install command in idemeum, create deployment in Immy, and deploy.

### **Obtain unified install script**

* Navigate to the admin portal of your `Main MSP dashboard`
* Click on the `Install new agent button`
* Copy and save the unified command for Windows

<img src="https://mintcdn.com/idemeum/NrvXMWPVPH2k-uve/images/immy1.png?fit=max&auto=format&n=NrvXMWPVPH2k-uve&q=85&s=18339eb13fb683d3456664591f62b0da" alt="Immy1" width="1600" height="1354" data-path="images/immy1.png" />

### **Create software package in Immy**

* Access your [Immy.bot](http://Immy.bot) management dashboard
* Navigate to `Library` → `Software` and click `New`

<img src="https://mintcdn.com/idemeum/NrvXMWPVPH2k-uve/images/immy2.png?fit=max&auto=format&n=NrvXMWPVPH2k-uve&q=85&s=ab5dce20d51c410e039d516122d55b6e" alt="Immy2" width="1600" height="1320" data-path="images/immy2.png" />

* For Installer Type choose `None` and click `Next`

<img src="https://mintcdn.com/idemeum/NrvXMWPVPH2k-uve/images/immy3.png?fit=max&auto=format&n=NrvXMWPVPH2k-uve&q=85&s=9cc5bb4a9f5b11974a9040b9d15117be" alt="Immy3" width="1600" height="1320" data-path="images/immy3.png" />

* Choose `Add version to new software`
* Provide the name of the software
* Upload the icon

<img src="https://mintcdn.com/idemeum/NrvXMWPVPH2k-uve/images/immy4.png?fit=max&auto=format&n=NrvXMWPVPH2k-uve&q=85&s=d65bcb6c170fa5081d10caaa122c9b6d" alt="Immy4" width="1600" height="1320" data-path="images/immy4.png" />

* For licensing choose `None`
* For `Version detection` choose `Custom Detection Script` and add the following script below
  * For script type use `Software detection`
  * Language is `Powershell`
  * Execution context `System`

```powershell theme={null}
# Step 1: retrive the registry key to identify that idemeum is installed
$key = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, [Microsoft.Win32.RegistryView]::Registry64)
$installed =  $key.OpenSubKey("SOFTWARE\Idemeum Inc\Idemeum Desktop Client")

#Step 2: if the agent is installed, retrive the version that is installed
if($installed) {
    $key = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, [Microsoft.Win32.RegistryView]::Registry64)
    $subKey =  $key.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{71216D26-573B-402B-A3F5-A7CB9F950CFF}")
    $installedVersion = $subKey.GetValue("DisplayVersion")
    Write-Host "Idemeum desktop agent is installed"
	return $installedVersion
    exit 0
} else {
    Write-Host "Idemeum desktop agent is not installed"
	exit -1
}
```

<img src="https://mintcdn.com/idemeum/NrvXMWPVPH2k-uve/images/immy6.png?fit=max&auto=format&n=NrvXMWPVPH2k-uve&q=85&s=0886e378d5a550f0ea92be96277464a3" alt="Immy6" width="1600" height="1320" data-path="images/immy6.png" />

* For installation we will use the command that you obtained in the previous section. Click `New` in the installation section to create new installation script.
* For script type choose `Software version action`, language is `Powershell` and execution context is `System`.
* Paste the command that you obtained from idemeum in the script editor window
* Scroll to `-customerName` variable and enter `$TenantName` inside `""`. This way we will automatically pass the organization name to idemeum script.

<img src="https://mintcdn.com/idemeum/NrvXMWPVPH2k-uve/images/immy7.png?fit=max&auto=format&n=NrvXMWPVPH2k-uve&q=85&s=55eeb724f5fb92059c2188bcb5822258" alt="Immy7" width="1600" height="1320" data-path="images/immy7.png" />

* Save the installation script and return to the previous menu

<img src="https://mintcdn.com/idemeum/NrvXMWPVPH2k-uve/images/immy8.png?fit=max&auto=format&n=NrvXMWPVPH2k-uve&q=85&s=196032fe853e1c32e474ee613bfd0894" alt="Immy8" width="1600" height="1320" data-path="images/immy8.png" />

* For `Uninstallation` section create new script and enter the script as below
  * Type is `Software version action`, execution context is `System` and language is `PowerShell`

```powershell theme={null}
Start-Process -FilePath "msiexec.exe" -ArgumentList "/x {93B9CC98-6004-411E-A8BF-88F7C3BC5541} /qn /norestart" -Wait
Start-Process -FilePath "msiexec.exe" -ArgumentList "/x {71216D26-573B-402B-A3F5-A7CB9F950CFF} /qn /norestart" -Wait
```

* For `Upgrade strategy` choose `Install over` as our installation script will handle all necessary actions. What is more idemeum offers the feature to automatically update agents when the new version is released. This feature is automatically enabled for your MSP tenant.

<img src="https://mintcdn.com/idemeum/NrvXMWPVPH2k-uve/images/immy10.png?fit=max&auto=format&n=NrvXMWPVPH2k-uve&q=85&s=556118cabe370f62cf27e4e5deb128b8" alt="Immy10" width="1600" height="1320" data-path="images/immy10.png" />

* Expand the `Advanced settings` and enable `Use dynamic versions`
* Add the new script for version detection
  * Type is `Dynamic versions`
  * Language is `PowerShell`
* Paste the following script for version detection

```powershell theme={null}
# Step 1: Identify latest Windows version from API response
$apiUrl = "https://dvmi.idemeum.com/api/system/info"
$response = Invoke-RestMethod -Uri $apiUrl -Method Get -ErrorAction Stop 
$desktopAppVersion = ($response.clientApplicationVersions | Where-Object { $_.applicationName -eq "DESKTOP_LOGIN_APP_WINDOWS" }).version

# Step 2: Construct the link for latest MSI installer download
$fileUrl = "https://asset.idemeum.com/desktoplogin/Idemeum_Desktop_Client_Main_v${desktopAppVersion}.msi"

# Step 3: Get dynamic version from installer
Get-DynamicVersionFromInstallerURL $fileUrl
```

* Save the dynamic version detection script

<img src="https://mintcdn.com/idemeum/NrvXMWPVPH2k-uve/images/immy11.png?fit=max&auto=format&n=NrvXMWPVPH2k-uve&q=85&s=ba7e5d7aa6dfd5a22c21dd246ffd8d89" alt="Immy11" width="1600" height="1320" data-path="images/immy11.png" />

* Now click `Next` and finish creating of idemeum software

### **Deploy software**

<Note>
  With this integration there is no need to create idemeum tenants manually. Simply deploy the agent in Immy and the idemeum customer tenant will be automatically created.
</Note>

Now you can create a deployment in [Immy.bot](http://Immy.bot) and idemeum agent will be installed and the software versions will be tracked and updated.

<img src="https://mintcdn.com/idemeum/bhXGrI8J28MDNihp/images/immy21.png?fit=max&auto=format&n=bhXGrI8J28MDNihp&q=85&s=978703166ae98b9323c1b0af89aa8530" alt="Immy21" width="1600" height="1231" data-path="images/immy21.png" />

<img src="https://mintcdn.com/idemeum/NrvXMWPVPH2k-uve/images/immy13.png?fit=max&auto=format&n=NrvXMWPVPH2k-uve&q=85&s=58697b2018326df944ac89f59b37c549" alt="Immy13" width="1600" height="1320" data-path="images/immy13.png" />

## **Catalog integration**

### **Create idemeum customer tenants**

<Warning>
  With this integration you first need to create idemeum customer tenants. There are various ways you can do this: manually, with CSV upload, or using idemeum API.
</Warning>

### **Enable idemeum integration in Immy**

* Access Immy admin dashboard
* Navigate to `Show more` → `Integrations` → `Add integration` and add Idemeum integration

<img src="https://mintcdn.com/idemeum/NrvXMWPVPH2k-uve/images/immy20.png?fit=max&auto=format&n=NrvXMWPVPH2k-uve&q=85&s=b41efeb6eac241cd47181475a5da4fea" alt="Immy20" width="1600" height="1242" data-path="images/immy20.png" />

* In the settings type your idemeum MSP tenant URL (i.e. `nikmsp.idemeum.com`)
* For the `ClientSecret` you need to paste the idemeum API key
  * Access idemeum admin portal
  * Go to `Global settings` → `Integrations`
  * If `Inbound` integration is already enabled, click on `...` and copy the API key
  * If `Inbound` integration is not enabled, simply create one by clicking on `Add integrations`
* Click `Update` to apply the changes to integration in Immy

### **Map customer tenants**

* In the Idemeum Immy integration click on `Clients` tab
* You can now map the customers in idemeum to customers in Immy

<img src="https://mintcdn.com/idemeum/bhXGrI8J28MDNihp/images/immy21.png?fit=max&auto=format&n=bhXGrI8J28MDNihp&q=85&s=978703166ae98b9323c1b0af89aa8530" alt="Immy21" width="1600" height="1231" data-path="images/immy21.png" />

* Customer list on the left comes from idemeum, then you need to click on the `Link` next to the customer you want to map, and then choose the customer in Immy

### **Deploy idemeum in Immy**

* Now you can start deploying idemeum agents to Immy managed endpoints
* Create a deployment, choose `Idemeum Global Software` and apply for the customer that was mapped with idemeum customer

<img src="https://mintcdn.com/idemeum/NrvXMWPVPH2k-uve/images/immy22.png?fit=max&auto=format&n=NrvXMWPVPH2k-uve&q=85&s=4f06508edf839bf777b4c0e58c90ae02" alt="Immy22" width="1600" height="1231" data-path="images/immy22.png" />

* Once the agents are deployed each machine will have the idemeum logo attached to it
