Hello,
I have a small powershell script that we run in Bigfix to add a user as a admin to their own machine:
add-localgroupmember -group 'Power Users' -member azuread\user.name@domain.com
What I want to do is run this as the local user account and add the user with a vaiable like this:
runas=currentuser
# Grab the upn of the user
wait powershell $upn = whoami /upn
# Add the local user to the admin group of the machine
wait powershell add-localgroupmember -group 'Power Users' -member azuread\$upn
Unfortunately it doesnt work, probably as my syntax isnt right, can anyone help please?
Javier.