[SOLVED] Adding the current user to a local group
Published: May 13, 2022 - 3:21 PM
Hello,
I would like to add the current user's account to a local group.
I found the correct way to do this with PowerShell: `
run_powershell('Add-LocalGroupMember -Group "OpenVPN Administrators" -Member "&username"')`.
When I run the script, it adds the system user to the group.
Using the command
`username = get_current_user()`
, I get the current user, but I'm stuck on how to pass the variable to my PowerShell line.
Is there a solution for this, or something simpler?
Thank you.
I would like to add the current user's account to a local group.
I found the correct way to do this with PowerShell: `
run_powershell('Add-LocalGroupMember -Group "OpenVPN Administrators" -Member "&username"')`.
When I run the script, it adds the system user to the group.
Using the command
`username = get_current_user()`
, I get the current user, but I'm stuck on how to pass the variable to my PowerShell line.
Is there a solution for this, or something simpler?
Thank you.