Hi everyone.
I have been slowly preparing for the move for all our work Macs over to High Sierra for the summer break (Work at a college). I've run into a minor hiccup in that my test High Sierra builds do not appear to run the login script we have been using to add Active Directory home folders to the sidebar under Favourites.
Works fine with our El Capitan and Sierra builds and I also do not see any errors in any JAMF logs on the High Sierra test clients.
The script is as follows:
#!/bin/sh
# Get Current Logged in User
LoggedinUser=`ls -l /dev/console | cut -d " " -f 4`
# Set UserID as ID of logged in user
UserID=`id -u $LoggedinUser`
logger -t Jigsaw24 "$UserID"
if (( $UserID < 1000 )); then
logger -t Jigsaw24 "Local Account - nothing to do. Exiting Script"
exit 0
fi
# Get Domain
Domain=`dscl /Active Directory/ -read . | grep SubNodes | awk '{print $NF}'`
logger -t Jigsaw24 "Domain = $Domain"
# Extract Current Users Home
SMBHome=`dscl /Active Directory/$Domain/All Domains -read /Users/$LoggedinUser SMBHome | awk '{print $2}' | tr '' '?' `
logger -t J24 "SMB Home Output = $SMBHome"
# Change "?" to "/" and removes first 7 characters.
change1=`echo $SMBHome | cut -c 7- | tr '?' '/' `
echo "change1 = $change1"
logger -t J24 "change1 Output = $change1"
# Prefix "Change1" with "/Volumes"
prefix=`echo "/Volumes$change1"`
echo "prefix = $prefix"
logger -t J24 "prefix Output = $prefix"
PathtoHome=`echo $SMBHome | tr '?' '/' | cut -c 1-`
echo "PathtoHome = $PathtoHome"
logger -t J24 "Path to Home = $PathtoHome"
PathtoHome=$prefix
echo "PathtoHome Modified = $PathtoHome"
logger -t J24 "Path to Home Modified = $PathtoHome"
# Get current Sidebar Entries
CurrentSidebar=`sfltool dump-storage ~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.FavoriteItems.sfl`
logger -t Jigsaw24 "Current Sidebar = $CurrentSidebar"
# Check if Sidebar Entry Exists
SidebarExists=`sfltool dump-storage /Users/$LoggedinUser/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.FavoriteItems.sfl | grep -ci $PathtoHome`
logger -t Jigsaw24 "Check for Existing Home Sidebar = $SidebarExists"
if (( $SidebarExists > 0 ))
then
logger -t Jigsaw24 "Sidebar Entry already exists"
exit 0
else
logger -t Jigsaw24 "Adding Sidebar Entry"
output=`sfltool add-item com.apple.LSSharedFileList.FavoriteItems "file://$PathtoHome"`
echo $output
fi
Hopefully something simple to correct this but we've hit a wall over this so far. We thought it might have been a permissions issue but Authenticated User and Self groups have read access to the Student Users OU and subsequent folders.
Regards
Jody Welch
QESFC
