Forum Discussion
flaviopbadmin
May 06, 2022Copper Contributor
How to allow powershell in managed device?
HI everyone, newbie admin here. I am in the process of learning out to use the EndPoint Manager and I have enrolled my first device, which will be my work laptop. It is running windows 11 enterpr...
DxR
May 07, 2022Iron Contributor
Hi,
- Backup Exexcution Value :
$BkpEP = Get-ExecutionPolicy -List
- Then reduce the ExecutionPolicy level :
Set-ExecutionPolicy -ExexcutionPolicy
- Import your module
- when it’s done revert back the ExecutionPolicy value
Set-ExecutionPolicy -ExecutionPolicy $BkpEP
Be carefull, if you stay with ExecutionPolicy to Bypass you are under security risk
- Backup Exexcution Value :
$BkpEP = Get-ExecutionPolicy -List
- Then reduce the ExecutionPolicy level :
Set-ExecutionPolicy -ExexcutionPolicy
- Import your module
- when it’s done revert back the ExecutionPolicy value
Set-ExecutionPolicy -ExecutionPolicy $BkpEP
Be carefull, if you stay with ExecutionPolicy to Bypass you are under security risk
flaviopbadmin
May 08, 2022Copper Contributor
I get this error and still not allowing me to run it or load the module
PS C:\Users\FlavioNeto> Set-ExecutionPolicy -ExecutionPolicy Bypass
Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by
a policy defined at a more specific scope. Due to the override, your shell will retain its current effective
execution policy of Unrestricted. Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more
information please see "Get-Help Set-ExecutionPolicy".
At line:1 char:1
+ Set-ExecutionPolicy -ExecutionPolicy Bypass
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [Set-ExecutionPolicy], SecurityException
+ FullyQualifiedErrorId : ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand
- DxRMay 08, 2022Iron ContributorRun the Get-ExecutionPolicy -List
That will display your actual config to find at what level it’s apply.
Any chance that you have a GPO in conflict with your CSP ?
If you don’t set the MDMWinsOverGP your GPO win and CSP never apply
https://docs.microsoft.com/en-us/windows/client-management/mdm/policy-csp-controlpolicyconflict- flaviopbadminMay 09, 2022Copper ContributorI have tried everytinh, even unrestricted for everything, but it always tells me it conflicts. And on the intune side, I can't find anything to change it.