Hi guys,
Am trying to set up a policy that can only be ran if user putting the right password.
- User go to Self Service, run the policy from Self Service and then a pop up appear displaying 5 digit random numbers and to advise them to ring the Service Desk
- User rings the Service Desk team with the 5 digit numbers and the Service Desk guy run another policy to input the 5 digit numbers to spit out the password to give back to User
- User put in the password and policy is ran.
#!/bin/bash
Numbers=$((RANDOM%55555+11111))
#Display the random numbers and advising user to call Service Desk on xxxx
dialog="$(osascript -e 'tell app "System Events" to display dialog "Please Contact Service Desk on xxxx with this numbers '"$Numbers"'. Continue?" buttons {"Yes", "No"} default button "No"')"
if [ "$dialog" = "button returned:Yes" ];
then
#prompt user for the password
2dialog="$(osascript -e 'Tell application "System Events" to display dialog "Enter your password given by the Service Desk" default answer ""' -e 'text returned of result' 2>/dev/null)"
#Generate the password by using $Numbers x Random Algorithm
#Check if password match
#if match
#run the policy
#if not, exit
exit 0
else
osascript -e 'tell application "System Events" to display dialog "Please run the program again when you are ready" buttons {"Acknowledge"} default button 1'
exit 0
fi
Can anyone please help on how can i achieve this?
Require the algorithm to use that random numbers to generate the final password on both Users and Service Desk side.
