get-winevent: unauthorized access exception on local pc.
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.
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.
- dan.potter
- Posts: 709
- Last visit: Wed Nov 14, 2018 11:39 am
get-winevent: unauthorized access exception on local pc.
I can't seem to find the right cause of this. I'm trying to get events out of the security log. I have UAC but it only prompts for elevation when installing software. Eventvwr does not prompt when opening the security log.
- dan.potter
- Posts: 709
- Last visit: Wed Nov 14, 2018 11:39 am
Re: get-winevent: unauthorized access exception on local pc.
My execution policy is set to unrestricted. I'm not running a script right now. I'm working in the shell to get the events I need first.
Re: get-winevent: unauthorized access exception on local pc.
The security Event log has been tagged to auto-elevate. This can be done for an EXE through CAS or in the registry.dan.potter wrote:My execution policy is set to unrestricted. I'm not running a script right now. I'm working in the shell to get the events I need first.
PowerShell does not allow this. You must elevate.
- dan.potter
- Posts: 709
- Last visit: Wed Nov 14, 2018 11:39 am
Re: get-winevent: unauthorized access exception on local pc.
Gotcha. Looks like start-job retains the elevated permissions when launching the main form elevated. This works for me.