How to change the value of a .ini file?

How to change the value of a .ini file?

I want to implement Custom Data for profile deployment filtering on my Zebra TC51 devices running Andorid 6.0.1

Is there a easy way to change the value of a section inside a .ini file?

28 Answers

Order By:   Standard | Newest | Votes
MichaelM | posted this 24 May 2018

Hello everybody,

 

I just installed MobiControl version 14.1.3.1587 and the profile got assigned to the device.

I also switched the custom data value back and forth from 'P' to 'Q'.... the profiles got assigned and revoked as planned.

 

Seems like this was a bug in version 14.1.0.1152

 

Thank you for all the help!

  • 0
  • 0
Support Staff | posted this 16 May 2018

Hi Michael, 

 

Yes, it seems that you have followed the steps they have used before to work around the issue.

 

Thank you for the input.  I will update your Technician with this information and look to see if there is another suggestion I can provide to your case.  Perhaps your technician will need to create a developers ticket with your scenario.

 

If there is anything else I can suggest you try I will update the tread, at this point we may need to wait for the fix in a newer build.

 

Regards,

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |

  • 0
  • 0
MichaelM | posted this 16 May 2018

Hi Support,

 

Custom Data value on the device was set to 'Q' and the profile for 'Q' was/is assigned.

Changed the value inside the .ini file to 'P' and tried out both scenarios:

 

Restart of the UI and restart of MS before a check-in of the device --> 'Q' profile still assigned

 

Checked-in the device, value got updated to 'P', restart UI --> profile still assgined

                                                                      restart MS --> profile still assigned

 

I hope I did everything correctly but It seems like this "work around" isn't working for me.

 

 

  • 0
  • 0
Support Staff | posted this 15 May 2018

Hi Michael, 

 

We currently have an improvement open with our developers for the version that you are on.   It seems that a restart of the MS allows the updated tables to begin the logic required to recognize the custom data and push the package/profile.   Obviously this is not a realistic long term resolution.  

 

Nonetheless, a restart of the UI (try logging out and back in) was determined as a " work around" but due to the lack of a check in I am skeptical that it will work. 

 

Logically speaking, I agree that the check in is required to get the updated data, feel free to try both scenario's before and after the check in for the desired actions.  

 

I may be able to provided your technician with some advice from the developers ticket after you update me on the outcome.  

 

 

 

 

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |

  • 0
  • 0
MichaelM | posted this 15 May 2018

Hi Support,

I'm sorry but how is the value supposed to get updated without a check-in?

Also Im not really sure on what you mean with restart/refresh the UI? Just a F5 while looking at the device in the webconsole?

  • 0
  • 0
Support Staff | posted this 14 May 2018

Hi Michael, 

 

As you are working through the case with our Support dept, can you try two things for me and let me know the outcome?

 

One is to restart/refresh the UI after you see the updated value in the console, preferably before the profile attempts to get assigned, (check - in).       

 

The second is to also restart the Management Service after the value is updated in the MobiControl Console, preferably before the profile attempts to get assigned as well.      \

 

I would like to share some information with you and your Support Technician but need to see if this makes a different or if the results are the same.

 

Cheers 

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |

  • 0
  • 0
MichaelM | posted this 14 May 2018

I hope they can fix it. :-)

Thank you very much again for all the help and the provided solutions.

 

I will update this thread if I have new information from SOTI.

  • 0
  • 0
Raymond Chan | posted this 14 May 2018

Based on what you just said, the problem is likely to be related to some event scheduling/triggering problem(s) overlooked within v14 implementation,  in which  there ia a new "search" module.  As there is no such problem in v13.4,  I'm pretty confident that Soti can fix it now that the issue has been reported.

 

  • 0
  • 0
MichaelM | posted this 14 May 2018

It's been about 4 hours since the change to the custom data value.

Yes, the custom data value reported at the web-console has been updated to P (pretty much immediately after switching the .ini files)

Checked-In the device multiple times. Manually and the scheduled check-in also took place already. Just requested a file-sync on the device but the profile is still assigned.

 

I haven't tried doing the Sync now on the MobiControl Seach Sync Interval again.

But at least for my understanding, that shouldn't be necessary or cant be the use case just to get the server to run its profile deployment schedule again.

  • 0
  • 0
Raymond Chan | posted this 14 May 2018

How long did you wait?  Have you checked to confirmed that the custom data value reported at the web-console  has already been updated to P?   Have you tried using any avalalble action options (e.g. check-in now or sync file now) to force the profile deployment change?  If that works, the remaining problem will be how to make the v14.x deployment server schedule the profile deployment in a more timely manner .

 

  • 0
  • 0
MichaelM | posted this 14 May 2018

Im on MobiControl Version 14.1.0.1152

 

Currently talking with support about this problem.

 

The profile got assigned after doing a manual sync of the search.

Going to All Platforms --> Servers --> Global Settings --> MobiControl Search Sync Interval --> Sync Now

 

Unfortunately when changing the Custom Data value from Q to P for example, the Profile filtered to the Q value keeps being assigned to the device.

  • 0
  • 0
Raymond Chan | posted this 09 May 2018

What is the  version and build number of your v14 MobiControl server?

I'll see if I can spare time to check things out again on our v14.x servers in the next two days.

  • 0
  • 0
MichaelM | posted this 09 May 2018

Hi Raymond,

I just changed the custom data to a integer value and changed the data collection rule.

Again, the custom data value is shown in the collected data tab but the Profile is still not getting assigned.

I can see the same error in the DSE logs that I've shown in a previous post.

Seems like this is a general problem with v14.

 

I will go ahead and open a support ticket.

 

Thank you very much for all the help.

  • 0
  • 0
Raymond Chan | posted this 08 May 2018

Hi Michael,

I just did a quick test on my latest v13.4 server, and profile got deployed/removed with numeric custom data, but failed if the custom data is a string.   I guess you can change your custom data to be an integer on your v14 server and test again.  It should be more or less the same.   If so,  I congratulate you for discovering a bug, which you can choose to report to Soti support team.  If not, you at least get a quick workaround that works for your case, I hope.

 

 

 

  • 0
  • 0
MichaelM | posted this 08 May 2018

Thank you for your reply.

The value 'Q' gets reported in the collected data tab

I already played around with putting space(s) in between the equal sign and 'Q'... spaces or no spaces did not make any difference. :(

But still no sign of the profile getting assigned to the device.

 

If I go the profile and right click it --> Assign profile --> Assign without any changes being made the profile gets assigned to the shown device.

Its almost like the server needs another form of data push to associate the filter criteria with the custom data value on the device.

  • 0
  • 0
Raymond Chan | posted this 08 May 2018

 

 

If you have 'any collected entries in  the data-collection tab in your web-console,   make sure you have a correct data-collection rule added for your custom data entry.  (Check for wrong collection schedule, wrong path or filename for .ini,  etc.)

 

If you did not get the value "Q" reported in collected entries in the data-collection tab in your web-console,  you have to check whether you leave space(s) in your .ini file  (i.e. no space before or after the EQUAL sign).

 

  • 0
  • 0
MichaelM | posted this 07 May 2018

Yes, the value shown is exactly what I set in the ini file

 

I've attached screenshots from the actual .ini file, profile filter criteria settings and the custom data definition itself.

If you need anything else please let me know.

Thank you!

  • 0
  • 0
Raymond Chan | posted this 07 May 2018

 

If the value in the webconsole gets changed, doesnt that mean the server did get the information from the device?

My Answer :  Yes only if the value shown is exactly what you set in your ini file on the device.

 

Can you attach a screenshot of what you set in your custom data expression field?

 

  • 0
  • 0
MichaelM | posted this 07 May 2018

In the DSE Logs I see following entry:

 

[2018-05-07 16:29:51.490] ERROR (285): Failed to process target of a profile 'Q_TC51_Apps' for device '7daebc042e2f7be2'
[2018-05-07 16:29:51.490] ERROR (285):

**************************************************************************
* Exception: Bad filter expression provided: customData['System'] = 'Q'. *
**************************************************************************
[DeviceFilterException: Bad filter expression provided: customData['System'] = 'Q'.]
   at Soti.MobiControl.DeviceConfiguration.Implementation.FilterCompilation.FilterCompiler`1.Compile(String filterText)
   at Soti.MobiControl.DeviceConfiguration.Implementation.FilterEngine.CreateFilterFunction(String filterExpression)
   at Soti.MobiControl.DeviceConfiguration.Implementation.ProfileDeviceTargetsProcessor.DoesSatisfyFilter(Device device, Profile profile)
   at Soti.MobiControl.DeviceConfiguration.Implementation.ProfileDeviceTargetsProcessor.ProcessDeviceTargets(Device device, Target[] targets)

**************************************************************************

 

Unfortunately I cant tell what's causing this. ('Q' is test and 'P' is live)

I couldn't find anything in the DS Logs....

 

@Raymond

If the value in the webconsole gets changed, doesnt that mean the server did get the information from the device?

 

@Matt & Raymond

Like I've stated before. I already tried to assign profiles based on custom attribute filtering but it didn't work. (I ran into the same problem I have now and Support told me to use seperate groups like you just told me again)

I dont want to use seperate groups for test and live because the devices technically are all in the same location. We have a lot of branch offices/stores and I track the device locations via device groups. I already have over 100 device groups. Adding 2 more for each branch office is not really best practice and makes things even more confusing.

Of course this would be the simplest method but why not use a feature like profile filtetring via custom data if it's there? (assuming it would work that is....)

  • 0
  • 0
Raymond Chan | posted this 07 May 2018

Hi Matt,

I totally agree with you.  Splitting the devices to be under two separate device group is one way, and using profile assignment filter based on custom attribute is another.   I actually don't know why Michael found the latter approach not working or not appropriate.  To me,  it seems to be the simplest and most flexible.    The worst drawback on v14.x server is that bulk import of custom attribute values to multiple devices  has not been added back in the new v14.x user interface (yet).

 

  • 0
  • 0
Matt Dermody | posted this 07 May 2018

Michael,

 

Might I also suggest the alternative of having two separate folders, one for Test and one for Live? If you're going to be setting this custom property value (whether attribute or data) from the MobiControl server side then you might as well just move devices between a Test and Live folder. 

  • 0
  • 0
Raymond Chan | posted this 07 May 2018

Adding a data-collection rule properly is definitely required.  The most frequent data-collection by the agent is every 2 minutes.  However, data collected is kept in the agent buffer and synced back to the server in bigger chunk.  So, don't assume you can get updated data automatically every 2 minutes.

 

Although I've asked Soti previously about any "reliable" way to force flushing of such data in the agent buffer to be synced back to the server,  I still receive no definite official answer on how to do it.  

 

  • 0
  • 0
MichaelM | posted this 07 May 2018

No, I didn't configure any data collection rule. Is this really necessary when using custom data as filter criteria for profile assignment? I tought when checking in the device it would send all information thats currently cached to the server?

 

The value in the webconsole get's changed after checking in the device. Guess I have to log into the logs....

 

MobiControl Server: 14.1.0.1152

Device Agent:  13.5.0.1088

Model: Zebra TC510K non GMS

 

  • 0
  • 0
Raymond Chan | posted this 07 May 2018

Did you add any data collection rule to retrieve the custom data?  How often is the data collection?  The data collected by the agent may still be cached in the agent's buffer and not yet synced back to your server. 

 

Have you checked the collected value on your web-console? If  the value has already been updated and your profile/package still doesn't get deployed, then you should check the deployment server log for any problem reported. 

 

What is your MobiControl server and device agent versions/build-numbers?  And what device brand/model?

  • 0
  • 0
MichaelM | posted this 07 May 2018

Thanks for the solution Raymond, using a template file should work. I didn't think of that.

 

This still leaves me with the problem, that my profiles dont get assigned to devices even when the Custom Data value for "System" is set on the devices.

  • 0
  • 0
MichaelM | posted this 07 May 2018

Yes, pretty much.

 

I have 2 profiles, each one installs packages to devices.

One profile is for a live version of our application the other one is for a test version. I want to set a custom data value("System") to each device that indicates which version is installed on the device (live or test) and filter profile deployment through this value aswell.

I want to be able to change the Custom Data value to "live" and the live version of our application gets installed and vice versa.

 

I tried doing this before with custom attributes but filtering profile assignment didnt work that way.... the profile just wouldnt get assigned to the device.

 

With that in mind I kinda also have the same problem with Custom Data now....

The Custom Data value "System" on the device is set to "test"

Profile filter criteria is System=test

The profile only gets assigned to the device if I go ahead and edit the profile and re-assign it again....not automatically. (Profile installation method is set to "Automatic")

  • 0
  • 0
Raymond Chan | posted this 07 May 2018

As far as I know, MobiControl script command set currently does not include any direct command to do what you want.  You likely need a custom-made app to support modifying arbitrary field(s)/line(s) in a general multi-section multi-line ini file.

 

However,  if you restrict yourself to use only one section and one data field in your ini file, and there can only be a very small number of possible values of such data field, then you can have multiple template files (one for each possible value) pre-pushed on the device ,and use Mobicontrol "copy" command to overwrite the ini file with the appropriate template file. 

 

  • 0
  • 0
Matt Dermody | posted this 07 May 2018

Can you explain your use case a little further? You are looking to be able to set some sort of property for the device from the console?

  • 0
  • 0

Give us your feedback
Give us your feedback
Feedback