I have a big PowerShell script that I want to run for each user automatically. I want to run this command as Admin and not have to specify credentials of other Standard users because all Standard users are Microsoft password-less accounts using Windows Hello authentication.
so far I managed to do this but it doesn't work for all users, only runs the script as Admin, which is the user that the PowerShell instances is running under.
$usernames = Get-LocalUser | ?{$_.enabled -EQ "True"} | select "Name"
$usernames | foreach { $bigscript }
$bigscript =
I read other guides but they all required me to specify credentials, but I don't have credentials. how can I do this?
I'm using latest version of Windows 11