Deploy profiles and applications based on user and path in SOTI MobiControl

Solved
EC
Enric Correa Yusa
mercadona001

Hi everyone,

We need to deploy profiles and applications to devices based on both the user and the path, for example:

  • (User A and Path A) or (User B and Path B)

We can’t achieve this using the Devices or Users tabs, since the conditions are added together rather than combined as “user AND path.”

The only possible approach we’ve found so far is using filters.
We can get the user from the Device Name (as we rename each device with the user’s name), but we can’t find a way to retrieve the Path.

Does anyone have any ideas or suggestions?
One possible solution could be using Custom Data, but in that case, we’d need something on the device that automatically writes its Path.

Thanks in advance!

Edited 17 days ago
SOTI MobiControl
ANSWERS
RS
Robert Schäfer
17 days ago

Hi Enric,

A tricky request, but not impossible.

There arn't any scripts that enable you to for example write the path to a file and then retrieve it using custom data.

Your best bet is to use REST API's.

If you are running a MobiControl version that supports signal policies and webhooks (2024+ i believe) you could use this to trigger a webhook to an endpoint that in turn retrieves the path of the device (using the deviceID passed in via the webhook) and writes the path into a custom attribute at a device level. The trigger would be the device moving from one group to another.

Kind regards,

Robert

Solution
A
ASMOD@SOTI
17 days ago

Dear Enric,

Thank you for posting on SOTI Pulse.

Many thanks Robert for your valuable inputs.

For more granular, dynamic control over file paths or specific actions, you can use the " if " command within a SOTI MobiControl script.

This method relies on checking environment variables that identify the current user. SOTI MobiControl supports using environment variables in scripts, such as %ENROLLEDUSER% or other custom data variables, to check the current user's identity. A script implementing the logic might look like this (syntax may vary slightly by OS platform):

if %ENROLLEDUSER% == "user a" // Commands for "path a" (e.g., copy files to a specific directory, run a specific command) md "1:\PersistentStorage\PathA" copy "1:\source\file_a.txt" "1:\PersistentStorage\PathA" endif

if %ENROLLEDUSER% == "user b" // Commands for "path b" md "1:\PersistentStorage\PathB" copy "1:\source\file_b.txt" "1:\PersistentStorage\PathB" endif

This script can be pushed to the device via an "Advanced Configuration" or as part of a package installation, allowing it to execute the relevant commands based on the logged-in user.

 

If you have any additional questions or concerns, please don't hesitate to reach out or you can contact us at  support@soti.net  

We're dedicated to providing assistance and support Also, if this post has helped you in solving your inquiry, I would request you to mark the particular comment as "is solution", so others may benefit from this information.

 Kind regards,

     SOTI

RS
Rafael Schäfer
16 days ago

Just want to poke here again, this example shows again why profiles and apps should have the same filter options as the device overview has. We raised this with an FR already long time ago (i don't have the FR number for now) so wonder why this isn'T still implemented. 

Could be a good reason to poke internally again about this!