Posted on 09-22-2017 06:16 AM
Does anyone have a script they'd be willing to share to display the computer's Active Directory name in Self Service? I've tried writing my own script and it's a challenge that exceeds my meager scripting abilities.
In case that's not clear, I'm looking for something along the lines of the scripts posted in this thread that displays the "Computer ID" in AD, instead of the IP address and ComputerName.
Solved! Go to Solution.
Posted on 09-22-2017 07:11 AM
Something like this?
#!/bin/bash
ADCompName=$(dsconfigad -show | awk -F'= ' '/Computer Account/{print $NF}')
if [[ ! -z "$ADCompName" ]]; then
text="Your Active Directory computer name is:
$ADCompName"
else
text="Your Mac is not joined to Active Directory"
fi
/usr/bin/osascript << EOD
set diagText to (do shell script "echo "$text"")
tell application "System Events"
display dialog diagText buttons {"OK"}
end tell
EOD
Posted on 09-22-2017 07:11 AM
Something like this?
#!/bin/bash
ADCompName=$(dsconfigad -show | awk -F'= ' '/Computer Account/{print $NF}')
if [[ ! -z "$ADCompName" ]]; then
text="Your Active Directory computer name is:
$ADCompName"
else
text="Your Mac is not joined to Active Directory"
fi
/usr/bin/osascript << EOD
set diagText to (do shell script "echo "$text"")
tell application "System Events"
display dialog diagText buttons {"OK"}
end tell
EOD
Posted on 09-22-2017 08:57 AM
Wow, thanks so much! That is just what I need.