最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

windows - Powershell and command prompt open as Administrator user instead of current user - Stack Overflow

programmeradmin1浏览0评论

I created a Windows 11 24H2 VM using this autounattend.xml and it works pretty good except for one issue...

When I am logged in as a local user (who has administrator privileges) and open command prompt, PowerShell or PowerShell 7 it always launches it as "Administrator" and not current user. This happens when using both Windows Terminal and ConHost app.

What am I missing? Any help would be much appreciated.

I created a Windows 11 24H2 VM using this autounattend.xml and it works pretty good except for one issue...

When I am logged in as a local user (who has administrator privileges) and open command prompt, PowerShell or PowerShell 7 it always launches it as "Administrator" and not current user. This happens when using both Windows Terminal and ConHost app.

What am I missing? Any help would be much appreciated.

Share Improve this question asked 9 hours ago RanvirRanvir 234 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

It sounds like your VM is automatically launching Command Prompt and PowerShell with Administrator privileges. Start by checking your UAC settings in the Control Panel and make sure it's not set to "Never notify." Then, open the regedit and make sure the AutoAdminLogon key is set to 0, and remove any Autorun entries under Command Processor. Next, run gpedit.msc and check that "User Account Control: Behavior of the elevation prompt" is set to "Prompt for consent." and Finally, if you’re using Windows Terminal, check the settings to ensure "elevate": true is set to false. This should stop Command Prompt and PowerShell from opening as Administrator by default.

I hope this helps!

发布评论

评论列表(0)

  1. 暂无评论