Skip to main content
Solved

"write defaults" script not running properly.

  • October 25, 2012
  • 3 replies
  • 17 views

Forum|alt.badge.img+13

Hey all,
Theres a command I am trying to use as a script but for some reason, it doesn't run. JSS shows the policy as successful.

#!/bin/sh
defaults write /Library/Preferences/com.apple.NetworkAuthorization UseShortName -bool YES

We have tried running this script at logon and startup to no avail.

Thanks in advance!

Best answer by jdziat

Maybe try something like this out

#! /bin/sh
sudo defaults write /Library/Preferences/com.apple.NetworkAuthorization UseShortName -bool YES;
if [ -f '/Library/Preferences/com.apple.NetworkAuthorization.plist' ] then exit 0;
fi exit 1;

3 replies

Forum|alt.badge.img+7
  • Contributor
  • Answer
  • October 25, 2012

Maybe try something like this out

#! /bin/sh
sudo defaults write /Library/Preferences/com.apple.NetworkAuthorization UseShortName -bool YES;
if [ -f '/Library/Preferences/com.apple.NetworkAuthorization.plist' ] then exit 0;
fi exit 1;


Forum|alt.badge.img+7
  • Contributor
  • October 25, 2012
#! /bin/sh
sudo defaults write /Library/Preferences/com.apple.NetworkAuthorization UseShortName -bool YES;
if [ -f '/Library/Preferences/com.apple.NetworkAuthorization.plist' ] 
then 
exit 0;
fi 
exit 1;

Sorry about that and the double post. You should be able to set up a managed preference for that as well


Forum|alt.badge.img+13
  • Author
  • Contributor
  • November 9, 2012

Sorry,
Sandy shut our district down for a week. The script seemed to work. Thanks jdziat!