Is there a way to run the sudo command in a Shell script but have it ask for the password in a GUI window similar to the one attached?

Is there a way to run the sudo command in a Shell script but have it ask for the password in a GUI window similar to the one attached?

Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.