Two questions: 1) Is there an easy way to automate renaming hostnames (changing the prefix if device is in specific directory)? 2) Is the _New Hostname_ field in the initial UMS Registration screen supposed to work? If I enter a custom name, it is never applied when the client appears in the console. I have to rename it once it’s in the console to take effect.
To clarify my first question, I’m going to have multiple directories that have devices requiring separate Imprivata computer policies applied to them. I want to automate as much as possible, and the only way for the Imprivata policy automation to work is if I use a custom prefix for each policy based on the device’s hostname. These devices aren’t in AD, so I can’t use that info.
Under system > firmware customizations > custom commands > base > Initialization I was able to add this code to automate naming convention to IG + the first 10 digits of the serial number. You should be able to use whatever logic you need to rename for your needs. Here is what I am using:
#!/bin/bash
RENAMEVAR=$(dmidecode -t system | grep -i “serial” | cut -c 17- | tail -c 11 | sed ‘s/^/IG/ ‘)
HOSTNAME=$(hostname)
if [ “$RENAMEVAR” != “$HOSTNAME” ]
then
setparam network.dns.hostname $RENAMEVAR
killall postsetupd
write_rmsettings
fi
If you need a specific naming standard for each OU you could potentially create a policy for each OU and name with script logic appropriately. Or even use 1 policy with template keys.
1) You could use my Powershell Module to rename your devices.: github.com/IGEL-Community/PSIGEL
I dont use Imprivata, but it seems odd to me that you cannot use directories for policies, maybe someone else has an idea here
2) yes this should work. Did you check the paragraph “Adjust Names of Devices” kb.igel.com/endpointmgmt-6.01/en/device-network-settings-10324069.html
@member Your solution would be ideal. I gave it a try, copying the entire script as written and plugging it into the Initialization field, but the device is never actually renamed. I don’t think it matters, but I do have _Adjust network name if UMS-internal name has been changed_.
@member Thank, I do have your PS tools. I guess I could script it to run automatically and handle this, but would really like to do this via a Profile if possible. As for the Imprivata policies, yeah, the options are limited.
Actually, I take that first reply back, the code is working. I had to enable the other ‘Adjust Names’ option. I’m trying to simply change the prefix from ITC to IGS, but my one modificatin doesn’t appear to work.
RENAMEVAR=$(hostname | sed ‘s/ITC/IGS/ ‘)
Hmm, I wonder if the hostname variable isn’t available at the time.
does it work on cli on a device?
$(hostname | sed ‘s/ITC/IGS/ ‘)
Yep, CLI works fine, which is why this was confusing me.
I’m testing out this line right now: RENAMEVAR=$(dmidecode -t baseboard | grep -i “Serial Number” | cut -c 17- | sed ‘s/^/IGS/’)
That worked. I’ll need to check other devices, but if the MAC is also the Serial Number in baseboard, I should be all set.
Continue reading and comment on the thread ‘Is there an easy way to automate renaming IGEL OS hostnames? and Is the _New Hostname_ field in the initial UMS Registration screen supposed to work? ‘. Not a member? Join Here!
Learn more, search the IGEL Knowledge Base
Ask a question or comment on the above message thread?
Join or log in to the IGEL Community to ask us anything and meet other IGEL customers, partners, and EUC enthusiasts.Submit a question, or Join Today!