10 Replies Latest reply on Oct 4, 2016 12:01 PM by jhellriegel

    Auto Set Device Name

    jsmith1 Apprentice

      Good morning,

      Users are notorious for leaving the name of their device as the default. So in the MDM it's a steady stream of

      ipad

      ipad

      ipad

      ipad

       

       

      Is there a way that when the user enrolls, the MDM can pull the "Device User Display Name" information and set auto set that as the name on the iPad?

        • 1. Re: Auto Set Device Name
          baotran Apprentice

          You could do something like this.

           

          1. Create a smart policy for Mobile Device Name - is - iPad.
          2. Create a new Set Mobile Device Name action.
          3. For Device name use ${MDU_DisplayName}.

           

          As devices are renamed they should drop out of this policy.

          • 2. Re: Auto Set Device Name
            jsmith1 Apprentice

            Our naming convention is Year of Graduation Last Name, First Name

            Ex: If I were a senior, my iPad would be named "17 Smith, Jeffrey"

             

            I created the policy as you showed with the added line of

            "Device User Organizational Unit - is - 2017" to make sure I'm only showing those in that graduation year.

             

            Can the Action be altered? 

            (I'm asking before I activate it and have to rename them a 2nd or 3rd time)

            Would it work to set the action to: 17 ${MDU_DisplayName}

            • 3. Re: Auto Set Device Name
              baotran Apprentice

              You probably want to test the action on a policy for a single iPad to make sure the action works correctly. Create a smart policy for that one device and assign it the action. So for the naming convention you want you'd use something like this for the device name.

               

              17 ${MDU_LastName}, ${MDU_FirstName} => "17 Smith, Jeffrey"

               

              MDU_DisplayName wouldn't give you the above desired format but would give you the below format instead.

               

              17 ${MDU_DisplayName} => "17 Jeffrey Smith"

              • 4. Re: Auto Set Device Name
                jhellriegel Rookie

                Bao,

                Can this be applied to Custom Fields as well?   What I want to do is use 2 custom fields to set first the device site and then the device property tag.  So would ${iOS Update}, {iOS FAST Property Tag} work?   They are string and number data types.  If not, I'd like to put in a feature request.

                • 5. Re: Auto Set Device Name
                  baotran Apprentice

                  Yes, that should work. Just remember to put a $ in from of the 2nd variable ${iOS FAST Property Tag}.

                  • 6. Re: Auto Set Device Name
                    jhellriegel Rookie

                    Hi Bao,

                    So I have experimented and the Custom Fields do not appear to work.  I tried the built-in variable of ${MD_SerialNumber} on the same test group of 3 iPads and it worked on 1.  The other 2 were iOS 10 devices and I am running a 7.2 console, so I will assume that functionality is not built in yet.  My question now is, since Custom Fields are not working, am I scripting the variables wrong? 

                     

                    I am using:  ${iOS Update}, ${iOS FAST Property Tag}

                     

                    If I look at the list of variables in Help, the device-based are abbreviated as MD_SerialNumber, MD_DataRoamingEnabled etc.  So are my spaces causing issues?  Does HEAT LANrev convert the custom fields into a different form for use as variable?  If so, where do I find these?

                    Appreciate it!

                     

                    Jennie

                    • 7. Re: Auto Set Device Name
                      baotran Apprentice

                      Variables names shouldn't have a space in them so I'm pretty sure that's the problem. Please change them to ${iOS_Update}, ${iOS_FAST Property_Tag}. That should get it to substitute the correct info in.

                      • 8. Re: Auto Set Device Name
                        jhellriegel Rookie

                        This still isn't working for me.  I have since updated to 7.3 and have tried various iterations of actions with custom fields and none of them work.   The actions using built-in variables work fine.

                        Right now, I have created a policy that includes three test iPads.  I initially set a rename device action to use two custom fields ${iOS_Update}, ${iOS_FAST_Property_Tag} and had no results.  So I dropped the first custom field to simplify and now have an action of rename device to only ${iOS_FAST_Property_Tag}.  Even after forcing a check-in on my test group and Re-Executing All Actions for This Device on all, nothing changes.

                        Please advise.

                        • 9. Re: Auto Set Device Name
                          baotran Apprentice

                          I tried this on my iPad and it worked for me. I did screw up the first time I did it since I deleted my device entry. That's a bit of a problem as that also removed the custom field data, which resulted in a comma for a device name. So I had to try again but this time only un-enroll my device so there was still a device entry there so that I could enter the custom field data for the unmanaged device entry. Some things to check.

                           

                          1. Please make sure that you've defined a mobile and not a desktop custom field. If you've defined a desktop custom field it'll be obvious when you try to enter the custom field data manually for a device and your custom fields don't show up on the list of fields you can enter data for. Might not be as obvious if you're importing data into these fields via CSV.

                          Windows_Server_2012_R2_2016.png

                          Windows_Server_2012_R2_2016.png

                          2. Make sure there is data entered for these fields for your 3 test iPads. Easiest way to simply add those 3 items to a computer group to make sure the data is present. This is where I messed up the first time around as I had no data for the custom fields and ended up with a comma for a device name.

                          Windows_Server_2012_R2_2016.png

                          3. Check that the variable name specified in your custom field definition matches what you're specifying in the action. Note that there is no $ nor squiggly brackets in the custom field definition itself, but only in the action when you're referencing the variable name for the custom field.

                          Windows_Server_2012_R2_2016.png

                           

                          I end up with this after it's done applying the action. I can repeat this by renaming my device locally on the iPad back to Bao iPad, sending an Update Device Info command so it shows up in the admin console again as Bao iPad, and then running Re-execute This Action for This Policy command to get it to rename itself again.

                          Windows_Server_2012_R2_2016.png

                          Here's a quick video run through of my test setup - http://www.mediafire.com/file/93obgai1coi83bg/rename_ipad_custom_field.mp4

                          • 10. Re: Auto Set Device Name
                            jhellriegel Rookie

                            Thanks Bao!  I ended up opening a ticket and got it working.   Two things were at issue: 1. My test devices had a name restriction profile.  Duh. Shoulda caught that.  2. I had everything else correct except for giving the actual custom field a variable name.  Quite frankly, when I opened up the custom fields I wanted to use, I was surprised to see that Variable Name field there.  The HEAT support tech said that field was added for Desktops with version 7.3, but he didn't know when it had been added for Mobile Devices.  Keep in mind, these Custom Fields of mine were created YEARS ago and I had no reason to look back.  And that goes back to my initial question (clear in retrospect but obtuse at the time) of where to find the variable names.  The fact is, my custom fields didn't have any variable names!

                            Long story short:  I created a policy with these conditions and it's working like a charm!    Thanks for all your help!  I'll ping you in Vegas.Rename iPads.PNG