new Win 10 computers and elevating explorer.exe with my administrative account

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
v35678
Posts: 23
Last visit: Fri Jan 05, 2024 8:25 am

new Win 10 computers and elevating explorer.exe with my administrative account

Post by v35678 »

Hi I have a strange issue with new Win 10 computers and elevating explorer.exe with my administrative account. I created a powershell app that serves as a menu system to launch other powershell apps with my admin id. So for example I set the admin credential with the following:

$global:cred = Get-Credential -Credential 'Domain1\'

Then start another app from the menu with the following example:

Start-Process "C:\Program Files\DesktopPowershellAPPS\Computer Support.exe" -Credential $cred

The Computer Support.exe then runs as my admin account. Everything works except when I try to do an admin share to the c: drive of a remote computer. It starts explorer.exe as my regular id that I'm logged into the computer with not my admin account. Here's the simple code for the admin share:

$computername = $textboxCN.text.Trim()
$files = "\\" + $computername + "\c$"
Start-Process explorer.exe $files

This is working on some of the Win 10 computers but not others. I'm stumped. Any ideas to get it to run as intended with the admin id?
Thanks for any help in advance.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: new Win 10 computers and elevating explorer.exe with my administrative account

Post by jvierra »

You cannot elevate "explorer" as it is the current session you are running. What is the purpose of this?

You can start an elevated session and then run explorer but explorer will still not be elevated.
User avatar
v35678
Posts: 23
Last visit: Fri Jan 05, 2024 8:25 am

Re: new Win 10 computers and elevating explorer.exe with my administrative account

Post by v35678 »

The purpose is to bring up the c: drive admin share of a remote computer. This is working on multiple computers but it is not on newer Win 10 computers.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: new Win 10 computers and elevating explorer.exe with my administrative account

Post by jvierra »

TO open the remote share just use the share name:

explorer '\\host\c$'
It works on Windows 10 just fine.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: new Win 10 computers and elevating explorer.exe with my administrative account

Post by jvierra »

The idea that it works on some W10 computers tells us that you have network issues. Also a recent patch caused some issues with access to admin shares on W10. Contact MS support for a patch. The latest update rollup should have fixed this but maybe it didn't.
User avatar
apowershelluser
Posts: 194
Last visit: Fri Mar 22, 2024 4:38 am
Answers: 2

Re: new Win 10 computers and elevating explorer.exe with my administrative account

Post by apowershelluser »

Is the reason you don't use invoke-item is because you don't want to type in your password for each new PC?

Just curious to be curious
User avatar
v35678
Posts: 23
Last visit: Fri Jan 05, 2024 8:25 am

Re: new Win 10 computers and elevating explorer.exe with my administrative account

Post by v35678 »

Yes this is a support application so we try to automate this as best we can. Like I said it works for some Win 10 computers. Very frustrating.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: new Win 10 computers and elevating explorer.exe with my administrative account

Post by jvierra »

"Works for some" says that you don't have a consistent configuration of Windows.
Also you cant use alternate credentials to a remote that you already have a connection to.

None of this has anything to do with elevation and nothing you are doing is elevating anything. "Elevation" is only used to the local system when a UAC prompt is displayed.

To access a remote admin share you must be a member of the remote systems Administrators group.
User avatar
v35678
Posts: 23
Last visit: Fri Jan 05, 2024 8:25 am

Re: new Win 10 computers and elevating explorer.exe with my administrative account

Post by v35678 »

Thanks for the info but it seems we are going in circles here. Absolutely it has to do with inconsistences with the Win 10 configurations and that’s why I reached out to see if anyone else has run into this. UAC does play a role because it comes up. But the good news is I figured it out. It turns out it is the following:
HKCR\AppID\ {CDCBCFCA-3CDC-436f-A4E2-0E02075250C2}
Ownership needs to be changed to administrators and then the runas key located here needs to be deleted or renamed.
We had this since Windows 7 and for whatever it was missed in some of the Win 10 configurations. I hope this helps out other people.
User avatar
apowershelluser
Posts: 194
Last visit: Fri Mar 22, 2024 4:38 am
Answers: 2

Re: new Win 10 computers and elevating explorer.exe with my administrative account

Post by apowershelluser »

thanks for the update! This has always been a wonder for me but never had the time to dig..

I cannot delete the key so it must be protected by GPO
This topic is 5 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked