Win11Debloat icon indicating copy to clipboard operation
Win11Debloat copied to clipboard

only works on admin user account and not second account

Open anonfaded opened this issue 1 year ago • 11 comments

It worked fine on admin main account on windows 11, but on second user account it isn't working. I opened powershell with admin priv but the script doesn't run so then i logged in from admin account and opened power shell > changed directory to other user and then used commands, it showed in terminal that it worked but it didn't remove anything when i logged in again from other account.

anonfaded avatar Jun 14 '24 17:06 anonfaded

Heya,

Is there a particular error showing when attempting to run the script for the second user?

Sidenote: The script applies most of the changes to the current logged in user, changing directory will not change the behaviour of the script.

Raphire avatar Jun 14 '24 22:06 Raphire

changing directory will not change the behaviour of the script.

oh so this is the issue then. The error i get on second user is that it needs admin priv to run the script, even when i open the power shell as admin, it still says that it needs admin priv to run the script.

And when i double click the script it just blinks the terminal window and closes itself, tried the advance method and all mentioned in README but it didn't work at all. It should work when power shell is opened as admin but idk why it still asked for admin priv.

anonfaded avatar Jun 15 '24 20:06 anonfaded

Interesting. I'll try to do some testing of my own to see if I can reproduce this issue.

Raphire avatar Jun 15 '24 22:06 Raphire

Interesting. I'll try to do some testing of my own to see if I can reproduce this issue.

Yeah you can reproduce it by using it on second user account and it will probably be same as what i got. On Admin power shell window it was still asking for admin rights so here idk if its the issue with the script or its how windows works on accounts with no admin priv.

anonfaded avatar Jun 15 '24 22:06 anonfaded

yes I can confirm the same here. We created a localAdmin account Ran it on there just fine then we joined it to the active directory domain logged in as a regular domain user attempted to run the debloat and asked for admin password in which we entered. It ran though its paces but didnt actually do anything in the end

johnnyq avatar Jun 21 '24 22:06 johnnyq

Heya,

Just wanted to do a quick update. I have been able to reproduce this issue myself.

The issue stems from the fact that the user context changes when running an elevated powershell prompt from a standard user account. This means the script will apply the changes to the admin account instead of the intended account.

I'll try to look into solutions for this issue and report back soon 🙃

Raphire avatar Jun 23 '24 00:06 Raphire

@Raphire Also i wanted to ask you that how to remove this windows update icon from start menu or stop windows from asking to update? idk whats the issue with it but it just keeps failing when i try to install the update. So i want to remove it completely. image

It always fails when it reaches 25% image

anonfaded avatar Jun 23 '24 02:06 anonfaded

@Raphire Also i wanted to ask you that how to remove this windows update icon from start menu or stop windows from asking to update? idk whats the issue with it but it just keeps failing when i try to install the update. So i want to remove it completely. image

It always fails when it reaches 25% image

There's ways to disable the icon as seen here: https://www.tenforums.com/tutorials/142276-enable-disable-windows-update-status-taskbar-icon-windows-10-a.html

But I would rather look into why the update fails and try to solve that. This recent wifi exploit is a great example of why it's important to keep your system up to date.

P.s. I have enabled discussions on this repo, this is a better place for these kinds of questions, rather than in this issue.

Raphire avatar Jun 23 '24 11:06 Raphire

I'm trying to troubleshoot this myself and i can really only think of elevating and de-elevating the user's permissions but that's a clear security risk.

Same issue with Sophia Script too, anyone got any other Debloating software? Specifically, something I can deploy.

Knight-sysdev avatar Aug 16 '24 17:08 Knight-sysdev

I'm trying to troubleshoot this myself and i can really only think of elevating and de-elevating the user's permissions but that's a clear security risk.

Same issue with Sophia Script too, anyone got any other Debloating software? Specifically, something I can deploy.

The reason for this issue comes down to the fact that the elevated powershell prompt is run within the context of the administrator account, not the logged in user. I am working on something that would allow you to select which user to apply changes to, but I haven't had a lot of time to work on it lately so I don't have an ETA unfortunately.

Raphire avatar Aug 16 '24 18:08 Raphire

Accidentally closed this issue, apologies 😅

Raphire avatar Aug 17 '24 10:08 Raphire

hello, i have the same problem, when i run the script via GPO and Active Directory on admin accounts everything works fine but on non admin account, it prompts the admin login on start and even if i log as admin it does nothing on the logged account, do you have a statut on that maybe ?

telmele avatar Jan 29 '25 09:01 telmele

hello, i have the same problem, when i run the script via GPO and Active Directory on admin accounts everything works fine but on non admin account, it prompts the admin login on start and even if i log as admin it does nothing on the logged account, do you have a statut on that maybe ?

Heya, I unfortunately don't have an ETA for this, but it's high on my list.

Raphire avatar Jan 30 '25 20:01 Raphire

Hey all! I found a workaround to this, thought I'd share.

Just change the second account from "Standard User" to "administrator", then when it asks for permission to modify, it asks the right user and stays on the same account! When you're done, just change it back to "Standard User". Hope this is helpful!

justdanwithaplan avatar Feb 28 '25 18:02 justdanwithaplan

The option to apply changes to a specific user (even non-admin users!) has been added as of 875d55f

To do this, simply run the script with the -User <USERNAME> parameter and provide the username. Example: ./Win11Debloat -User raphire

Do note that this functionality has only been tested with local accounts, and that the user must exist, must have logged on at least once before, and must not be logged on at the time of running the script. The script will show an error if the registry hive for the specified user cannot be found at the expected location %USERPROFILE%\NTUSER.DAT

I will be leaving this issue open to keep an eye on how well this works out.

Thanks!

Raphire avatar Mar 05 '25 22:03 Raphire

Closing this issue as the feature has been live for a while without any reported issues. Please do feel free to open a new issue if any issue does arise.

Raphire avatar Mar 17 '25 23:03 Raphire