Assign a Device Name on Android plus v5.1.1 Enterprise enrollment

LR
Lionel, RAULT
Solutys Technologies

The following syntax doesnt work :

MyDevice %TXT://\storage\sdcard0\SotiMobiControlIdent.txt?LN=1%

Mobicontrol doesnt resolve %TXT...%

Do you have a way to assign a device name by reading a given file present on the device ?

Thanks,

7 years ago
Android
ANSWERS
MD
Matt Dermody Diamond Contributor
7 years ago (edited 7 years ago)

To my knowledge, that is not possible given the available options. With that being said, I have been proven wrong before as there are certainly features and functionality not expressly documented. Here are the options that I am familiar with when auto-assigning a Device Name during enrollment:

 

RC
Raymond Chan Diamond Contributor
7 years ago (edited 7 years ago)

Hi Lionel,

Your problem is probably related to how you defined the path storing the file AND/OR to the unsupported script syntax that you used.

Assume your file "SotiMobiControlIdent.txt" on the device is located at  the "Download" directory of the internal flash file system

  and the required device name in on line 1

Then, you can try the following scripts :

  set MyDevName=TXT://%sdcard%\Download\SotiMobiControlIdent.txt?LN=1

  devrename  "%MyDevName%"

I don't know about your device brand/model, nor any possible customization of the firmware on your device and the device agent version/build number.  So, this might not work.  

Good luck!

LR
Lionel, RAULT
7 years ago

its a Unitech EA600 Android 5.1.1

Agent 13.5.0 Build 1110

Instead of using the default Device Name with %AUTONUM%, i try to give the device a name more suitable to my customer.

Since this declaration is at the end of the device rule creation (device name prompt), it is not in a script.

i've tried without success :

MyDevice %TXT://%sdcard%\Download\SotiMobiControlIdent.txt?LN=1%

MyDevice %TXT://1:\storage\sdcard0\Download\SotiMobiControlIdent.txt?LN=1%

MyDevice %TXT://\1:\storage\sdcard0\Download\SotiMobiControlIdent.txt?LN=1%

I guess that this feature i was using on Windows Devices is not available anymore on Androids

RC
Raymond Chan Diamond Contributor
7 years ago

Hi Lionel,

You cannot use your macro in the device naming pattern tab in add-devices rule.  Just leave it to whatever, maybe something like "Android  %AUTONUM%".

Then after the device enrollment is complete, send the script commands I suggested to the device to test if the renaming gets done properly.  If it works  fine, you can always make the process automatic later by adding the script commands to the pre-script section of a file-sync rule targeted to the device group of your initial enrollment. 

LR
Lionel, RAULT
7 years ago

Raymon,

Sending a script with the set command doesnt work :

set MyDevName=hello
showmessagebox  "%MyDevName%"

the result on the device is a messagebox with %MyDevName% in it, but not hello !?

and your script :

  set MyDevName=whateveryouplacehere

  devrename  "%MyDevName%"

changes the name of the device into %MyDevName% !!

in the meantime, I've changed the agent which now is : 13.3.2 build 1014

MobiControl on the PC : V13.3.0.3851

SS
Support Staff Account
7 years ago (edited 7 years ago)

Hi Lionel, 

To see a list of Macro's that are supported with the naming of a Android device try creating or editing a add device rule.  I will add an screenshot of where this can be found but you will have to select each one to get the corresponding Macro that is supported on Android devices.

Supported naming Macro's

RC
Raymond Chan Diamond Contributor
7 years ago

Hi Lionel,

I retested the script and confirmed it to be working when running in the command shell tool of a conventional remote-control session.

I got similar problem when sending the script command with a "send script" action, possibly because the full-blown command shell supporting environment variables is not used to handle the command.

I'll let you know if I can find a workaround.

LR
Lionel, RAULT
7 years ago

You are right Raymond, the set instruction works in a shell command

LR
Lionel, RAULT
7 years ago

RC
Raymond Chan Diamond Contributor
7 years ago

Hi Lionel,

I had no doubt about that on command shell.

I did some tests two years ago and I remembered  it was possible to use "send script" action to do something similar with environment variables.  I have to check past records  to see what  tricks were used back then.

LR
Lionel, RAULT
7 years ago

Unfortunately, the set instruction is not supported on MobiControl Android (it's in the help doc); so not much can be done with scripts on Android !

LR
Lionel, RAULT
7 years ago

How do you set the PERSONALIZED_DEVICE_NAME var on an Android plus ?

RC
Raymond Chan Diamond Contributor
7 years ago (edited 7 years ago)

The online document is not always 100% accurate.  There are many undocumented script commands, and some commands become obsolete in newer agent/server versions, or vary between platforms.

Similar Discussions