dsccommunity / dsccommunity/ComputerManagementDsc

Resource to handle SmartScreen Filter

Open
#73 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
PowerShell
Stars
338
Forks
80
PR merge metrics
No merged PRs in 30d

Description

I used this script to turn off Smart Screen filter. I suggest we make this into a resource, or add this as a parameter to an existing resource.
I do not know if this module is the correct one for this. If not, let me know and I will submit this in the correct module.

SmartScreen Filter: FAQ

If there is a better way to accomplish this, then please let me know. 😄

        Script (New-ResourceName -Name 'EnableSmartScreenFilter')
        {
            SetScript = {
                <#
                    'Off' equals off.
                    'Prompt' equals 'Warn before running an unrecognized app, but don't require administrator approval'.
                    'RequireAdmin' equals 'Get administrator approval before running an unrecognizd app from the Internet (recommended)'
                #>
                Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name SmartScreenEnabled -ErrorAction Stop -Value 'RequireAdmin' -Force
            }

            TestScript = {
                $smartFilterStatus = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer' -Name SmartScreenEnabled -ErrorAction SilentlyContinue).SmartScreenEnabled

                return ($smartFilterStatus -eq 'RequireAdmin')
            }

            GetScript = {
                $smartFilterStatus = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer' -Name SmartScreenEnabled -ErrorAction SilentlyContinue).SmartScreenEnabled
                
                return @{
                    SmartFilterStatus = $smartFilterStatus
                }
            }
        }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed PowerShell DSC script and the SmartScreen Filter FAQ, then compare the registry setting with the repository’s existing resource structure. Decide whether SmartScreen belongs in a new resource or an existing resource parameter, and verify that configuration, testing, and retrieval consistently handle the proposed SmartScreenEnabled values.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.