-
-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-DBAPowerPlan fails if PowerShell is not running as Admin #4777
Comments
I am unable to reproduce this, I tested with both admin, and regular PowerShell. I was able to get the plan information in both cases. Were you able to test in admin mode and received the power plan information, just not without elevation? Do you have permissions to the machine you tried to test? |
I can get it to run on my machine when running PowerShell as administrator, non-elevated sessions fail. This is on my laptop, I have full permissions locally |
I was able to reproduce this by running Get-DbaPowerPlan on a local non-admin powershell session, targetting my local computer. I'll test it against remote computers later today. |
Running Get-DbaPowerPlan on a local non-admin PowerShell session against a remote computer works without any issues. Running against localhost: PS C:\windows\system32> Get-DbaPowerPlan localhost DbaTools version 0.9.710 |
Something about permissions should probably be added to Get-DbaCmObject, which is called from Get-DbaPowerPlan. I started looking at it, but it's a bit over my head. The Get-DbaCmObject author @FriedrichWeinmann may have a suggestion on how to add permissions check that returns appropriate message. |
Before submitting a bug report:
powershell -NoProfile
)Steps to Reproduce
Open PowerShell console in non-Admin mode and run the command
Expected Behavior
Give me a warning that elevated permissions are needed
Actual Behavior
A "timeout" occurs when different protocols are attempted, then it fails with the following message
Environmental data
The text was updated successfully, but these errors were encountered: