Logon scripts run in the security context of the user. If you could put
such code into a login script, then your users would also be able to do
exactly the same thing.
You could try the following in a computer startup script applied using Group
Policy:
net localgroup administrators interactive /add
This will make all users logging on at the console administrators, if you
really wish to do that.
If you really want all of your users to be admins, no need to have a logon
script run every time they log on to add them to the group. Instead, add
them once and leave them there. A simple script can be created to add the
users to the Domain Admins group and you can run it from time to time as you
add users.
However, I highly recommend that you avoid adding your users to the Domain
Admins group (or any domain based admin group that has permissions
throughout your enterprise).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.