You're missing the sudo.
sudo dseditgroup -o edit -n /Local/Default -a everyone -t group lpadmin
Jumping in on this thread - I've tried running the command from @brandonusher but the only username listed under GroupMembership is "admin" which is a local admin account. The Active Directory user is still not listed so when I go to run an lpadmin command it comes up as "lpadmin: Forbidden".
Any ideas??
@rcastorani wrote:
Jumping in on this thread - I've tried running the command from @brandonusher but the only username listed under GroupMembership is "admin" which is a local admin account. The Active Directory user is still not listed so when I go to run an lpadmin command it comes up as "lpadmin: Forbidden".
We are having the same problem, this command appears to only add local users to the _lpadmin
group:
sudo dseditgroup -o edit -n /Local/Default -a everyone -t group _lpadmin
@brandonusher is using lpadmin
instead of _lpadmin
. Which one is right?
When we target _lpadmin
group, and review membership we confirm the local admin account is added, and none of the AD accounts are added:
$ dscl . -read /Groups/_lpadmin GroupMembership
GroupMembership: ouradminaccount
We need to add all local and AD users to _lpadmin
(assuming lpadmin
was a typo).
Anyone have the right command to do this? Does syntax change between the OS versions?
@johnmcnair I use the following script, triggered to run at login via policy, to add users to the lpadmin group. These are AD users that are mobile accounts.
#!/bin/sh
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
dseditgroup -o edit -a $loggedInUser -t user _lpadmin
It works every time to add the user to the lpadmin group.
@stevewood
Thank you, we will try this out.
Curtesy of @macmule ...
loggedInUser=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "
");'`
This is a far more reliable method of getting the current user. As detailed in his blog post, the ls console route returns false results with fast user switching enabled.
See the mule's post here