Skip to main content
Question

Variables in Managed Preferances

  • April 25, 2013
  • 5 replies
  • 15 views

Forum|alt.badge.img+3

Hi All,

does anyone know if I can pass a variable in a Managed Preference? I can do that in Windows when using GPO, but tried $USER and well it spat out $USER :)

Also as I've added my Mac to the Domain, how do I get the user long name (ie lastname / firstname )instead of the login account name, did a Google but came up short.

Thanks,

Barry

5 replies

Forum|alt.badge.img+10
  • Contributor
  • April 25, 2013

Maybe Managed Preferences is not the way you want to do what you're trying to do, you may want to consider using scripts / payload free packages run via Policy to get what you want done.

Can you share what you're trying to accomplish on your Macs?


mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • April 25, 2013

If you're talking about straight Managed Preferences in the JSS, then no, not that I'm aware of. Its not a script so its not going to understand variables. However, you could write up a script to use a variable that would then write in the actual value with 'defaults write blah key $USER' or such. The issue with that is, just using defaults write doesn't allow you to truly manage it, meaning, lock it into place. There may be a way, but I don't know how myself. For anything that has to be set and grayed out, usually Managed Preferences work best for that.

If on the other hand, its a one time setting, or something you'd like to set at each login, a script set up as a login policy could do it.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • April 26, 2013

HI Guys,

thanks for the replies, that's a bit frustrating lol.

What I am wishing to do is set the Users first name / last name in Office 2011, this will run when the user logs in and I'm not fussy about it being hard coded as it is unique to each users login.

Script sounds better, just need to figure how to do a policy logon script (no idea about logon scripts on a Mac) and learn some Bash scripting I guess :) Can I use Perl? I did some Perl scripting 7 or so years ago. I guess I can also expand on the script.

Thanks,

Barry


Forum|alt.badge.img+10
  • Valued Contributor
  • April 26, 2013

Hey, Barry:

Have a look at http://www.officeformachelp.com/outlook/exchange/setup-script/

If you're using in-house Exchange or 365, this will populate everything in Outlook but the password.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • April 26, 2013

Thanks tuinte, that seems like just the ticket!

Cheers,

Barry