A Forum reader recently asked:
"We have a login script that our Marketing department uses, but there are sometimes people who work on our webpage who need an administrative account. Can we adapt the script to work for them as well?"
And here's the response from David Guest ...
You can't easily tell if the user is going to need the admin privileges or not. So you need to ask them. I would do some thing like this:
Title "Netzwerkkennwort eingeben"
If %Department eq "Marketing"
MessageBox -yesno ?Answer "Do you need Administration Access ?"
If ?Answer eq "Yes"
Setprompt "Admin Username:"
Type $Username #1218
Type $Password #1219
Type ?Sysuser #1218
Type ?Syspassword #1219
Setprompt "Enter your sign-on variables"
## EndSection: "Login Window"
This uses a directory variable "Department" to determine that the user is in the Marketing department. You may want to use a different variable though - for example, you could try something like:
If $SysUser(system) -In "NAme 1 Name2 Name3 Name4"