What is the best way to get the RealName of the current logged in user? I am writing an Extension attribute to call an AD group and if the AD group contains a match of the real name of the logged in user to that of the AD group then you receive a Yes or No output.
Answer
Get RealName of Current Logged in User
Best answer by rmanly
try mine; like this
#!/bin/bash
group="FNGMACAPPSTORE"
for username in $(stat /dev/console | awk '{print $5}'); do
if dscl /Search -read /Users/"${username}" memberOf | grep -q "${group}"; then
echo "<result>Yes</result>"
else
echo "<result>No</result>"
fi
doneEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
