{"id":239944,"date":"2024-04-22T10:32:55","date_gmt":"2024-04-22T10:32:55","guid":{"rendered":"https:\/\/www.ninjaone.com\/?post_type=script_hub&#038;p=239944"},"modified":"2024-04-22T10:32:55","modified_gmt":"2024-04-22T10:32:55","slug":"configurazione-di-notizie-e-interessi-con-powershell","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/it\/script-hub\/configurazione-di-notizie-e-interessi-con-powershell\/","title":{"rendered":"Padroneggiare PowerShell: Automatizzare la configurazione di Notizie e interessi in Windows"},"content":{"rendered":"<h2>Punti chiave<\/h2>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"1\" data-aria-level=\"1\"><strong>Controllo automatico:<\/strong> Lo script automatizza la gestione della funzionalit\u00e0 Notizie e interessi in Windows 10 e &#8220;Widget&#8221; in Windows 11.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"2\" data-aria-level=\"1\"><strong>Gestione multiutente:<\/strong> Consente di apportare modifiche a tutti i profili utente di un sistema, coprendo vari tipi di account.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"3\" data-aria-level=\"1\"><strong>Sono richiesti privilegi amministrativi:<\/strong> L&#8217;esecuzione dello script per configurare Notizie e interessi richiede i diritti amministrativi per modificare le impostazioni del sistema.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"4\" data-aria-level=\"1\"><strong>Modifiche alla chiave di registro:<\/strong> La funzione centrale dello script per configurare Notizie e interessi \u00e8 la capacit\u00e0 di alterare chiavi di registro specifiche in base alla versione del sistema operativo.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"5\" data-aria-level=\"1\"><strong>Opzione per un effetto immediato:<\/strong> Lo script per configurare Notizie e interessi pu\u00f2 riavviare Windows Explorer per applicare le modifiche istantaneamente, evitando il riavvio del sistema.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"6\" data-aria-level=\"1\"><strong>Versatilit\u00e0 d&#8217;uso:<\/strong> Ideale per gli ambienti aziendali, per garantire l&#8217;uniformit\u00e0 e ridurre al minimo le distrazioni su tutti i computer della societ\u00e0.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"7\" data-aria-level=\"1\"><strong>Superiore ai metodi manuali:<\/strong> Offre un approccio pi\u00f9 efficiente rispetto alle tradizionali modifiche manuali o alle regolazioni dei criteri di gruppo.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"8\" data-aria-level=\"1\"><strong>Reversibilit\u00e0:<\/strong> Le modifiche apportate dallo script per configurare Notizie e interessi possono essere annullate, consentendo una certa flessibilit\u00e0 nella gestione delle impostazioni del sistema.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"9\" data-aria-level=\"1\"><strong>Si consigliano misure di sicurezza:<\/strong> Per un uso sicuro ed efficace degli script per configurare Notizie e interessi, si consiglia di adottare precauzioni quali test approfonditi, backup del registro e una documentazione chiara.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"10\" data-aria-level=\"1\"><strong>Gestione IT migliorata con strumenti dedicati:<\/strong> L&#8217;integrazione di questo script per configurare Notizie e interessi in piattaforme come NinjaOne pu\u00f2 semplificare ulteriormente le attivit\u00e0 di gestione IT.<\/li>\n<\/ul>\n<p>Gli script PowerShell sono diventati uno strumento essenziale nell&#8217;arsenale dei professionisti IT, perch\u00e9 offrono un potente mezzo per automatizzare e gestire vari aspetti dei sistemi Windows. Una di queste attivit\u00e0 \u00e8 la configurazione della funzionalit\u00e0 &#8220;Notizie e interessi&#8221; in Windows 10 e della scheda &#8220;Widget&#8221; in Windows 11. Questa funzionalit\u00e0, pur essendo utile per alcuni, pu\u00f2 essere una distrazione o un elemento indesiderato per altri, soprattutto in un ambiente professionale. Capire come gestire in modo efficiente questa funzionalit\u00e0 \u00e8 fondamentale per mantenere uno spazio di lavoro efficiente e dove sia possibile concentrarsi.<\/p>\n<h2>Background<\/h2>\n<p>Lo script per configurare Notizie e interessi \u00e8 progettato per dare agli amministratori il controllo sulla visualizzazione della scheda &#8220;Notizie e interessi&#8221; (o scheda &#8220;Widget&#8221; in Windows 11) nella barra delle applicazioni. Questo aspetto \u00e8 particolarmente importante per i professionisti IT e i <a href=\"https:\/\/www.ninjaone.com\/it\/cos-e-un-msp\" target=\"_blank\" rel=\"noopener\">Managed Service Provider (MSP)<\/a> che gestiscono ambienti con pi\u00f9 utenti. La possibilit\u00e0 di attivare, disattivare o impedire le modifiche a queste funzioni da remoto e di farlo in massa garantisce un ambiente uniforme per gli utenti, fondamentale sia per la <a href=\"https:\/\/www.ninjaone.com\/it\/blog\/checklist-della-sicurezza-informatica-per-proteggere-le-aziende\/\" target=\"_blank\" rel=\"noopener\">sicurezza<\/a> che per la facilit\u00e0 di gestione.<\/p>\n<h2>Lo script per configurare Notizie e Interessi in Windows:<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">#Requires -Version 5.1\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    Hides or shows the 'News and Interests' tab in the taskbar. On Windows 11, it hides or shows the widgets tab.\r\n.DESCRIPTION\r\n    Hides or shows the 'News and Interests' tab in the taskbar. On Windows 11, it hides or shows the widgets tab.\r\n.EXAMPLE\r\n    (No Parameters)\r\n    \r\n    WARNING: Hiding News and Interests from the taskbar for all users!\r\n    Registry::HKEY_USERS\\S-1-12-1-2117605486-1182246982-3318994623-3070967164\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDa changed from 1 to 0\r\n    Registry::HKEY_USERS\\S-1-5-21-4122835015-3639794443-155648563-1001\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDa changed from 1 to 0\r\n    WARNING: This script will take effect the next time the user completes a full sign-in or restarts.\r\n\r\nPARAMETER: -Enable\r\n    Reveals the 'News and Interests' tab in the taskbar.\r\n.EXAMPLE\r\n    -Enable\r\n\r\n    Revealing News and Interests for all users!\r\n    Registry::HKEY_USERS\\S-1-12-1-2117605486-1182246982-3318994623-3070967164\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDa changed from 0 to 1\r\n    Registry::HKEY_USERS\\S-1-5-21-4122835015-3639794443-155648563-1001\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDa changed from 0 to 1\r\n    WARNING: This script will take effect the next time the user completes a full sign-in or restarts.\r\n\r\nPARAMETER: -PreventChanges\r\n    Should the end-user be able to modify this setting after it's been set with this script?\r\n.EXAMPLE\r\n    -PreventChanges\r\n    \r\n    WARNING: Hiding News and Interests from the taskbar for all users!\r\n    Set Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Dsh\\AllowNewsAndInterests to 0\r\n    WARNING: This script will take effect the next time the user completes a full sign-in or restarts.\r\n\r\nPARAMETER: -RestartExplorer\r\n    In order for this script to take immediate effect, explorer.exe will need to be restarted.\r\n.EXAMPLE\r\n    -RestartExplorer\r\n\r\n    WARNING: Hiding News and Interests from the taskbar for all users!\r\n    Registry::HKEY_USERS\\S-1-12-1-2117605486-1182246982-3318994623-3070967164\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDa changed from 1 to 0\r\n    Registry::HKEY_USERS\\S-1-5-21-4122835015-3639794443-155648563-1001\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDa changed from 1 to 0\r\n    WARNING: Restarting Explorer.exe\r\n\r\n.OUTPUTS\r\n    None\r\n.NOTES\r\n    Minimum Supported OS: Windows 10+\r\n    Release Notes: Initial Release\r\nBy using this script, you indicate your acceptance of the following legal terms as well as our Terms of Use at https:\/\/www.ninjaone.com\/it\/condizioni-utilizzo\r\n    Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms. \r\n    Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party. \r\n    Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library or website belonging to or under the control of any other software provider. \r\n    Warranty Disclaimer: The script is provided \u201cas is\u201d and \u201cas available\u201d, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations. \r\n    Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks. \r\n    Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script. \r\n    EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).\r\n#&gt;\r\n\r\n[CmdletBinding()]\r\nparam (\r\n    [Parameter()]\r\n    [Switch]$Enable,\r\n    [Parameter()]\r\n    [Switch]$PreventChanges = [System.Convert]::ToBoolean($env:preventChanges),\r\n    [Parameter()]\r\n    [Switch]$RestartExplorer = [System.Convert]::ToBoolean($env:restartExplorer)\r\n)\r\n\r\nbegin {\r\n    # Grabbing dynamic script variables\r\n    if ($env:showOrHide -and $env:showOrHide -notlike \"null\") { if ($env:showOrHide -eq \"Show\") { $Enable = $True } }\r\n\r\n    # Check if script is running with local admin privileges.\r\n    function Test-IsElevated {\r\n        $id = [System.Security.Principal.WindowsIdentity]::GetCurrent()\r\n        $p = New-Object System.Security.Principal.WindowsPrincipal($id)\r\n        $p.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)\r\n    }\r\n\r\n    # Get a list of all the user profiles for when the script is run as System.\r\n    function Get-UserHives {\r\n        param (\r\n            [Parameter()]\r\n            [ValidateSet('AzureAD', 'DomainAndLocal', 'All')]\r\n            [String]$Type = \"All\",\r\n            [Parameter()]\r\n            [String[]]$ExcludedUsers,\r\n            [Parameter()]\r\n            [switch]$IncludeDefault\r\n        )\r\n    \r\n        # User account SID's follow a particular pattern depending on if they're Azure AD or a Domain account or a local \"workgroup\" account.\r\n        $Patterns = switch ($Type) {\r\n            \"AzureAD\" { \"S-1-12-1-(\\d+-?){4}$\" }\r\n            \"DomainAndLocal\" { \"S-1-5-21-(\\d+-?){4}$\" }\r\n            \"All\" { \"S-1-12-1-(\\d+-?){4}$\" ; \"S-1-5-21-(\\d+-?){4}$\" } \r\n        }\r\n    \r\n        # We'll need the NTuser.dat file to load each user's registry hive. So we grab it if their account sid matches the above pattern. \r\n        $UserProfiles = Foreach ($Pattern in $Patterns) { \r\n            Get-ItemProperty \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\*\" |\r\n                Where-Object { $_.PSChildName -match $Pattern } | \r\n                Select-Object @{Name = \"SID\"; Expression = { $_.PSChildName } },\r\n                @{Name = \"UserName\"; Expression = { \"$($_.ProfileImagePath | Split-Path -Leaf)\" } }, \r\n                @{Name = \"UserHive\"; Expression = { \"$($_.ProfileImagePath)\\NTuser.dat\" } }, \r\n                @{Name = \"Path\"; Expression = { $_.ProfileImagePath } }\r\n        }\r\n    \r\n        # There are some situations where grabbing the .Default user's info is needed.\r\n        switch ($IncludeDefault) {\r\n            $True {\r\n                $DefaultProfile = \"\" | Select-Object UserName, SID, UserHive, Path\r\n                $DefaultProfile.UserName = \"Default\"\r\n                $DefaultProfile.SID = \"DefaultProfile\"\r\n                $DefaultProfile.Userhive = \"$env:SystemDrive\\Users\\Default\\NTUSER.DAT\"\r\n                $DefaultProfile.Path = \"C:\\Users\\Default\"\r\n    \r\n                $DefaultProfile | Where-Object { $ExcludedUsers -notcontains $_.UserName }\r\n            }\r\n        }\r\n    \r\n        $UserProfiles | Where-Object { $ExcludedUsers -notcontains $_.UserName }\r\n    }\r\n\r\n    # Helper function for setting registry keys\r\n    function Set-RegKey {\r\n        param (\r\n            $Path,\r\n            $Name,\r\n            $Value,\r\n            [ValidateSet(\"DWord\", \"QWord\", \"String\", \"ExpandedString\", \"Binary\", \"MultiString\", \"Unknown\")]\r\n            $PropertyType = \"DWord\"\r\n        )\r\n        if (-not $(Test-Path -Path $Path)) {\r\n            # Check if path does not exist and create the path\r\n            New-Item -Path $Path -Force | Out-Null\r\n        }\r\n        if ((Get-ItemProperty -Path $Path -Name $Name -ErrorAction Ignore)) {\r\n            # Update property and print out what it was changed from and changed to\r\n            $CurrentValue = (Get-ItemProperty -Path $Path -Name $Name -ErrorAction Ignore).$Name\r\n            try {\r\n                Set-ItemProperty -Path $Path -Name $Name -Value $Value -Force -Confirm:$false -ErrorAction Stop | Out-Null\r\n            }\r\n            catch {\r\n                Write-Error \"[Error] Unable to Set registry key for $Name please see below error!\"\r\n                Write-Error $_\r\n                exit 1\r\n            }\r\n            Write-Host \"$Path\\$Name changed from $CurrentValue to $($(Get-ItemProperty -Path $Path -Name $Name -ErrorAction Ignore).$Name)\"\r\n        }\r\n        else {\r\n            # Create property with value\r\n            try {\r\n                New-ItemProperty -Path $Path -Name $Name -Value $Value -PropertyType $PropertyType -Force -Confirm:$false -ErrorAction Stop | Out-Null\r\n            }\r\n            catch {\r\n                Write-Error \"[Error] Unable to Set registry key for $Name please see below error!\"\r\n                Write-Error $_\r\n                exit 1\r\n            }\r\n            Write-Host \"Set $Path\\$Name to $($(Get-ItemProperty -Path $Path -Name $Name -ErrorAction Ignore).$Name)\"\r\n        }\r\n    }\r\n\r\n    # Restarts explorer.exe\r\n    function Reset-Explorer {\r\n        Write-Warning \"Restarting Explorer.exe\"\r\n        \r\n        Start-Sleep -Seconds 1\r\n        Get-Process explorer | Stop-Process -Force\r\n        Start-Sleep -Seconds 1\r\n\r\n        if (-not (Get-Process explorer)) {\r\n            Start-Process explorer.exe\r\n        }\r\n    }\r\n    \r\n    # Gets the OS Name E.g. Windows 10 Enterprise or Windows 11 Enterprise\r\n    function Get-OSName {\r\n        systeminfo | findstr \/B \/C:\"OS Name\"\r\n    }\r\n\r\n    $OSName = Get-OSName\r\n}\r\nprocess {\r\n    if (-not (Test-IsElevated)) {\r\n        Write-Error -Message \"Access Denied.\" -RecommendedAction \"Please run with Administrator privileges.\" -Exception (New-Object -TypeName System.UnauthorizedAccessException) -Category PermissionDenied\r\n        exit 1\r\n    }\r\n\r\n    # The registry key is different depending on if its Windows 10 or Windows 11\r\n    if ($OSName -Like \"*11*\") {\r\n        $AllUserPath = (Get-ItemProperty -Path \"Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Dsh\" -ErrorAction Ignore).AllowNewsAndInterests\r\n    }\r\n    else {\r\n        $AllUserPath = (Get-ItemProperty -Path \"Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Feeds\" -ErrorAction Ignore).EnableFeeds\r\n    }\r\n\r\n    # Issues a warning prior to removing the registry key that prevents changes from end-users\r\n    if ($AllUserPath -ge 0) {\r\n        $EnableOrDisable = switch ($AllUserPath) {\r\n            1 { \"revealed\" }\r\n            default { \"hidden\" }\r\n        }\r\n\r\n        if (-not ($PreventChanges)) {\r\n            Write-Warning \"News and Interests is currently $EnableOrDisable for all users. Removing 'Prevent Changes' setting to replace it with individual user setting as requested.\"\r\n            \r\n            if ($OSName -Like \"*11*\") {\r\n                Remove-ItemProperty -Path \"Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Dsh\" -Name \"AllowNewsAndInterests\"\r\n            }\r\n            else {\r\n                Remove-ItemProperty -Path \"Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Feeds\" -Name \"EnableFeeds\"\r\n            }\r\n        }\r\n    }\r\n\r\n    if ($OSName -Like \"*11*\") {\r\n        $KeyPath = \"Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Dsh\"\r\n        $KeyName = \"AllowNewsAndInterests\"\r\n        $Value = if ($Enable) { 1 }else { 0 }\r\n    }\r\n    else {\r\n        $KeyPath = \"Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Feeds\"\r\n        $KeyName = \"EnableFeeds\"\r\n        $Value = if ($Enable) { 1 }else { 0 }\r\n    }\r\n\r\n    # Sets a per user registry key if the end-user lock isn't set\r\n    if (-not ($PreventChanges)) {\r\n        $UserProfiles = Get-UserHives -Type \"All\"\r\n\r\n        $KeyPath = New-Object System.Collections.Generic.List[string]\r\n        $LoadedProfiles = New-Object System.Collections.Generic.List[Object]\r\n\r\n        Foreach ($UserProfile in $UserProfiles) {\r\n            # Load User ntuser.dat if it's not already loaded\r\n            If ((Test-Path \"Registry::HKEY_USERS\\$($UserProfile.SID)\" -ErrorAction Ignore) -eq $false) {\r\n                $LoadedProfiles.Add($UserProfile)\r\n                Start-Process -FilePath \"cmd.exe\" -ArgumentList \"\/C reg.exe LOAD HKU\\$($UserProfile.SID) `\"$($UserProfile.UserHive)`\"\" -Wait -WindowStyle Hidden\r\n            }\r\n            if ($OSName -Like \"*11*\") {\r\n                $KeyPath.Add(\"Registry::HKEY_USERS\\$($UserProfile.SID)\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\")\r\n            }\r\n            else {\r\n                $KeyPath.Add(\"Registry::HKEY_USERS\\$($UserProfile.SID)\\Software\\Microsoft\\Windows\\CurrentVersion\\Feeds\")\r\n            }\r\n        }\r\n\r\n        if ($OSName -Like \"*11*\") {\r\n            $KeyName = \"TaskbarDa\"\r\n            $Value = if ($Enable) { 1 }else { 0 }\r\n        }\r\n        else {\r\n            $KeyName = \"ShellFeedsTaskbarViewMode\"\r\n            $Value = if ($Enable) { 0 }else { 2 }\r\n        }\r\n    }\r\n\r\n    # Change the message depending on if we're hiding or showing the menu\r\n    if ($Enable) {\r\n        Write-Host \"Revealing News and Interests for all users!\"\r\n    }\r\n    else {\r\n        Write-Warning \"Hiding News and Interests from the taskbar for all users!\"\r\n    }\r\n    \r\n    # Setting the registry key\r\n    $KeyPath | ForEach-Object { Set-RegKey -Path $_ -Name $KeyName -Value $Value }\r\n\r\n    # Unload any profiles we loaded up earlier (if any)\r\n    Foreach ($LoadedProfile in $LoadedProfiles) {\r\n        [gc]::Collect()\r\n        Start-Sleep 1\r\n        Start-Process -FilePath \"cmd.exe\" -ArgumentList \"\/C reg.exe UNLOAD HKU\\$($LoadedProfile.SID)\" -Wait -WindowStyle Hidden | Out-Null\r\n    }\r\n\r\n    # Restart explorer.exe\r\n    if ($RestartExplorer) {\r\n        Reset-Explorer\r\n    }\r\n    else {\r\n        Write-Warning \"This script will take effect the next time the user completes a full sign-in or restarts.\"\r\n    }\r\n}\r\nend {\r\n    \r\n    \r\n    \r\n}<\/pre>\n<p>&nbsp;<\/p>\n\n<div class=\"in-context-cta\"><p style=\"text-align: center;\">Accedi a oltre 700 script nel Dojo di NinjaOne<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.ninjaone.com\/it\/prova-gratuita\/\">Ottieni l&#8217;accesso<\/a><\/p>\n<\/div>\n<h2>Analisi dettagliata dello script per configurare Notizie e interessi<\/h2>\n<ol>\n<li><strong> Inizializzazione e impostazione dei parametri:<\/strong> Lo script per configurare Notizie e interessi inizia impostando i parametri per abilitare la funzionalit\u00e0, impedire le modifiche da parte degli utenti finali e decidere se riavviare Windows Explorer per le modifiche immediate. Inoltre, lo script per configurare Notizie e interessi regola dinamicamente alcune impostazioni in base alle variabili ambientali.<\/li>\n<li><strong> Controllo dei privilegi dell&#8217;amministratore:<\/strong> Un passo fondamentale \u00e8 la verifica dei privilegi amministrativi. Lo script controlla se \u00e8 in esecuzione con i permessi necessari, assicurandosi che non vengano apportate modifiche non autorizzate.<\/li>\n<li><strong> Gestione del profilo utente:<\/strong> Identifica tutti i profili utente del sistema, passaggio essenziale per applicare le impostazioni a pi\u00f9 utenti. Questo include la gestione di diversi tipi di account, come di Azure AD, di dominio o account locali.<\/li>\n<li><strong> Manipolazione della chiave di registro:<\/strong> Lo script per la configurazione di Notizie e interessi accede e modifica il registro di Windows. \u00c8 qui che si attiva o disattiva la funzionalit\u00e0 &#8220;Notizie e interessi&#8221; o &#8220;Widget&#8221;. A seconda della versione del sistema operativo (Windows 10 o 11), lo script lavora su chiavi di registro diverse.<\/li>\n<li><strong> Riavviare il processo di esplorazione:<\/strong> Opzionalmente, lo script per l&#8217;impostazione di Notizie e interessi pu\u00f2 riavviare il processo di Windows Explorer per applicare immediatamente le modifiche, senza richiedere l&#8217;accesso dell&#8217;utente o il riavvio del sistema.<\/li>\n<\/ol>\n<h2>Casi d&#8217;uso potenziali<\/h2>\n<p>Immagina un ambiente aziendale in cui il reparto IT deve garantire uno spazio di lavoro standardizzato e privo di distrazioni su tutti i computer aziendali. Utilizzando questo script per configurare Notizie e interessi, \u00e8 possibile disattivare la funzionalit\u00e0 &#8220;Notizie e interessi&#8221; su tutti i computer in modo efficiente, garantendo un&#8217;esperienza utente coerente e riducendo al minimo le distrazioni.<\/p>\n<h2>Confronti<\/h2>\n<p>Tradizionalmente, questi interventi richiedevano la modifica manuale del registro o dei criteri di gruppo. Questo script semplifica il processo, consentendo di apportare modifiche in modo rapido e in blocco, rispetto ai metodi manuali che richiedono molto tempo.<\/p>\n<h2>Domande frequenti<\/h2>\n<p><strong>D1: Questo script per configurare Notizie e interessi funziona su qualsiasi versione di Windows?<br \/>\n<\/strong>A1: Lo script \u00e8 progettato per Windows 10 e versioni successive.<\/p>\n<p><strong>D2: L&#8217;accesso come amministratore \u00e8 obbligatorio per eseguire questo script per configurare Notizie e interessi?<br \/>\n<\/strong>A2: S\u00ec, per apportare modifiche al registro sono necessari i privilegi di amministrazione.<\/p>\n<p><strong>D3: Questo script per configurare Notizie e interessi pu\u00f2 annullare le modifiche, permettendo di tornare allo stato precedente se necessario?<br \/>\n<\/strong>A3: S\u00ec, lo script pu\u00f2 attivare o disattivare la funzionalit\u00e0, consentendo quindi la reversibilit\u00e0.<\/p>\n<h2>Implicazioni<\/h2>\n<p>Sebbene questo script sia decisamente utile, \u00e8 importante considerarne le implicazioni. L&#8217;uso non autorizzato pu\u00f2 portare a configurazioni indesiderate del sistema e gli errori involontari nell&#8217;esecuzione possono portare all&#8217;instabilit\u00e0 del sistema.<\/p>\n<h2>Raccomandazioni<\/h2>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"1\" data-aria-level=\"1\"><strong>Esegui dei test accurati:<\/strong> Esegui lo script per configurare Notizie e interessi in un ambiente controllato prima della distribuzione.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"2\" data-aria-level=\"1\"><strong>Effettua un backup dei registri:<\/strong> Esegui sempre un backup delle impostazioni del registro prima di apportare modifiche.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"3\" data-aria-level=\"1\"><strong>Documentazione chiara:<\/strong> Mantieni una documentazione chiara delle modifiche apportate utilizzando questo script per riferimenti futuri.<\/li>\n<\/ul>\n<h2>Considerazioni finali<\/h2>\n<p>Nel campo della gestione IT, strumenti come NinjaOne svolgono un ruolo fondamentale. Offrono una piattaforma unificata per il <a href=\"https:\/\/www.ninjaone.com\/it\/gestione-endpoint\/monitoraggio-e-avvisi\/\" target=\"_blank\" rel=\"noopener\">monitoraggio e l&#8217;automazione delle attivit\u00e0 IT<\/a>, compresa la distribuzione degli script. Questo script PowerShell, combinato con uno strumento di gestione solido come NinjaOne, pu\u00f2 migliorare in modo significativo la capacit\u00e0 di un professionista IT di gestire e mantenere operativo il proprio ambiente digitale, aiutando a ottenere <a href=\"https:\/\/www.ninjaone.com\/it\/efficienza-it\/\" target=\"_blank\" rel=\"noopener\">efficienza<\/a> e controllo maggiori.<\/p>\n","protected":false},"author":35,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","_lmt_disableupdate":"no","_lmt_disable":""},"operating_system":[4212],"use_cases":[4269],"class_list":["post-239944","script_hub","type-script_hub","status-publish","hentry","script_hub_category-windows"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/script_hub\/239944","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/script_hub"}],"about":[{"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/types\/script_hub"}],"author":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/comments?post=239944"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/media?parent=239944"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/operating_system?post=239944"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/use_cases?post=239944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}