UI in Self Service Policies

awuerch
New Contributor

Hi There,

 

If there is a similar thread already - sorry i could not find it.

 

My question is following - We want to make a couple of Policies in Self Service where there is some for of UI. Forexample a policy to create a new account, and to have a Dialog window asking for name and password, etc.. (Users dont have admin access). 

 

We are trying to make an easy enrollment for workers who use a certain mac for maybe a week, then pass it on to another colleague. Practically we are hopign that maybe via Self Service, when the new user gets their laptop (or the before the old user gives back the laptop) that they via self service they can delete their own user, or create it. 

 

Instead of having to reenroll the mac everytime it changes hands. 

 

Any thoughts to this? Thanks

1 REPLY 1

mm2270
Legendary Contributor III

You'll probably want to look at using osascript (AppleScript) within a script for something like this, which can display fields for secure text input. Here's a simple example showing this:

#!/bin/zsh

usernamePrompt=$(/usr/bin/osascript <<- EOD
tell application "System Events"
	get text returned of (display dialog "Enter your username below:" default answer "")
end tell
EOD
)

passwordPrompt=$(/usr/bin/osascript <<- EOD
tell application "System Events"
	get text returned of (display dialog "Enter your password below:" default answer "" with hidden answer)
end tell
EOD
)

echo "$usernamePrompt"
echo "$passwordPrompt"