{"id":391028,"date":"2024-12-13T07:54:36","date_gmt":"2024-12-13T07:54:36","guid":{"rendered":"https:\/\/www.ninjaone.com\/?post_type=script_hub&#038;p=391028"},"modified":"2024-12-13T07:54:36","modified_gmt":"2024-12-13T07:54:36","slug":"script-desactiver-la-connexion-automatique","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/fr\/script-hub\/script-desactiver-la-connexion-automatique\/","title":{"rendered":"Renforcer la s\u00e9curit\u00e9 avec PowerShell\u00a0: d\u00e9sactiver la connexion automatique et imposer CTRL+ALT+SUPPR\u00a0"},"content":{"rendered":"<p>Dans les environnements informatiques, la s\u00e9curit\u00e9 est primordiale et chaque couche de d\u00e9fense est importante. Une mesure de s\u00e9curit\u00e9 souvent n\u00e9glig\u00e9e consiste \u00e0 demander aux utilisateurs d&rsquo;appuyer sur\u00a0<strong>CTRL+ALT+SUPPR<\/strong>\u00a0avant de se connecter. Cette action agit comme une s\u00e9quence d&rsquo;attention s\u00e9curis\u00e9e (SAS), garantissant que l&rsquo;\u00e9cran de connexion est authentique et qu&rsquo;il ne s&rsquo;agit pas d&rsquo;une interface usurp\u00e9e cr\u00e9\u00e9e par un malware.<\/p>\n<p>Pour les professionnels de l&rsquo;informatique et les <a href=\"https:\/\/www.ninjaone.com\/fr\/quest-ce-quun-msp\">fournisseurs de services g\u00e9r\u00e9s (MSP)<\/a>, l&rsquo;automatisation de ces t\u00e2ches permet de gagner du temps et de renforcer la coh\u00e9rence. C&rsquo;est pr\u00e9cis\u00e9ment ce que fait le script <a href=\"https:\/\/www.ninjaone.com\/it-hub\/endpoint-management\/what-is-powershell\/\">PowerShell<\/a> fourni : il permet de d\u00e9sactiver la connexion automatique et applique l&rsquo;exigence <strong>CTRL+ALT+SUPPR<\/strong>\u00a0sur les syst\u00e8mes Windows.<\/p>\n<h2>Comprendre la n\u00e9cessit\u00e9 de pratiques de connexion s\u00e9curis\u00e9es<\/h2>\n<p>L&rsquo;exigence\u00a0<strong>CTRL+ALT+SUPPR<\/strong>\u00a0n&rsquo;est pas l\u00e0 juste pour emb\u00eater les utilisateurs, elle offre des avantages cruciaux en mati\u00e8re de s\u00e9curit\u00e9. Cette combinaison garantit que les utilisateurs interagissent avec le sous-syst\u00e8me d&rsquo;authentification s\u00e9curis\u00e9 du syst\u00e8me d&rsquo;exploitation plut\u00f4t qu&rsquo;avec des programmes potentiellement malveillants. La d\u00e9sactivation de la connexion automatique emp\u00eache \u00e9galement tout acc\u00e8s non autoris\u00e9 dans les environnements partag\u00e9s ou sensibles. Les professionnels de l&rsquo;informatique qui g\u00e8rent des flottes d&rsquo;appareils trouveront ce script tr\u00e8s utile pour impl\u00e9menter rapidement ces param\u00e8tres dans tous les syst\u00e8mes.<\/p>\n<h2>Le script\u00a0:<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">#Requires -Version 5.1\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    Disables the automatic login feature and requires 'CTRL', 'ALT', and 'DELETE' to be pressed each time a user signs in. Once 'Interactive logon: Do not require CTRL+ALT+DEL' is apart of the security policy it cannot be removed from the policy. It either has to be enabled or disabled.\r\n.DESCRIPTION\r\n    Disables the automatic login feature and requires 'CTRL', 'ALT', and 'DELETE' to be pressed each time a user signs in. Once 'Interactive logon: Do not require CTRL+ALT+DEL' is apart of the security policy it cannot be removed from the policy. It either has to be enabled or disabled.\r\n\r\n    By using this script, you indicate your acceptance of the following legal terms as well as our Terms of Use at https:\/\/www.ninjaone.com\/terms-of-use.\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.EXAMPLE\r\n    (No Parameters)\r\n    \r\n    Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\AutoAdminLogon changed from 1 to 0\r\n    Retrieving existing security policy...\r\n                                                                            \r\n    The task has completed successfully.\r\n    See log %windir%\\security\\logs\\scesrv.log for detail info.\r\n    Modifying policy to require Ctrl Alt Del to be pressed on login.\r\n    Applying updated policy...\r\n    Completed 5 percent (0\/18) \tProcess Security Policy area        \r\n    Completed 22 percent (3\/18) \tProcess Security Policy area        \r\n    Completed 44 percent (7\/18) \tProcess Security Policy area        \r\n    Completed 61 percent (10\/18) \tProcess Security Policy area        \r\n    Completed 77 percent (13\/18) \tProcess Security Policy area        \r\n    Completed 100 percent (18\/18) \tProcess Security Policy area        \r\n                                                                            \r\n    The task has completed successfully.\r\n    See log %windir%\\security\\logs\\scesrv.log for detail info.\r\n\r\nPARAMETER: -MicrosoftDefaults\r\n    Reverts all the modified settings to their Microsoft default value.\r\n\r\nPARAMETER: -ForceRestart\r\n    Schedules a restart for 60 seconds from now so that the CTRL+ALT+DEL login requirement may take immediate effect.\r\n\r\n.NOTES\r\n    Minimum OS Architecture Supported: Windows 10, Windows Server 2016\r\n    Release Notes: Initial Release\r\n#&gt;\r\n\r\n[CmdletBinding()]\r\nparam (\r\n    [Parameter()]\r\n    [Switch]$MicrosoftDefaults = [System.Convert]::ToBoolean($env:revertToMicrosoftDefaults),\r\n    [Parameter()]\r\n    [Switch]$ForceRestart = [System.Convert]::ToBoolean($env:forceRestart)\r\n)\r\n\r\nbegin {\r\n\r\n    function Test-IsDomainJoined {\r\n        if ($PSVersionTable.PSVersion.Major -lt 5) {\r\n            return $(Get-WmiObject -Class Win32_ComputerSystem).PartOfDomain\r\n        }\r\n        else {\r\n            return $(Get-CimInstance -Class Win32_ComputerSystem).PartOfDomain\r\n        }\r\n    }\r\n\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\r\n        # Check if the specified path exists, if not, create it.\r\n        if (-not $(Test-Path -Path $Path)) {\r\n            New-Item -Path $Path -Force | Out-Null\r\n        }\r\n\r\n        # Check if the property already exists at the path.\r\n        if ((Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue)) {\r\n\r\n            # Retrieve the current value of the registry key.\r\n            $CurrentValue = (Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue).$Name\r\n            try {\r\n                # Attempt to update the property's value.\r\n                Set-ItemProperty -Path $Path -Name $Name -Value $Value -Force -Confirm:$false -ErrorAction Stop | Out-Null\r\n            }\r\n            catch {\r\n                # If an error occurs during the update, print an error message and exit.\r\n                Write-Host \"[Error] Unable to Set registry key for $Name please see below error!\"\r\n                Write-Host \"[Error] $($_.Message)\"\r\n                exit 1\r\n            }\r\n            # Print a confirmation of the change.\r\n            Write-Host \"$Path\\$Name changed from $CurrentValue to $($(Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue).$Name)\"\r\n        }\r\n        else {\r\n            try {\r\n                # If the property does not exist, create it with the specified value and type.\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                # If an error occurs during creation, print an error message and exit.\r\n                Write-Host \"[Error] Unable to Set registry key for $Name please see below error!\"\r\n                Write-Host \"[Error] $($_.Exception.Message)\"\r\n                exit 1\r\n            }\r\n\r\n            # Print a confirmation of the change.\r\n            Write-Host \"Set $Path\\$Name to $($(Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue).$Name)\"\r\n        }\r\n    }\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    if (!$ExitCode) {\r\n        $ExitCode = 0\r\n    }\r\n}\r\nprocess {\r\n    # Check if the current user session is elevated with administrator privileges. If not, display an error message and exit the script.\r\n    if (!(Test-IsElevated)) {\r\n        Write-Host -Object \"[Error] Access Denied. Please run with Administrator privileges.\"\r\n        exit 1\r\n    }\r\n\r\n    # Retrieve the AutoAdminLogon and DefaultPassword registry values to check for automatic login settings and stored passwords.\r\n    $AutoLogin = Get-ItemProperty -Path \"Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" -Name \"AutoAdminLogon\" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty \"AutoAdminLogon\" -ErrorAction SilentlyContinue\r\n    $DefaultPassword = Get-ItemProperty -Path \"Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" -Name \"DefaultPassword\" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty \"DefaultPassword\" -ErrorAction SilentlyContinue\r\n    $PasswordLessSetting = Get-ItemProperty -Path \"Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\PasswordLess\\Device\" -Name \"DevicePasswordLessBuildVersion\" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty \"DevicePasswordLessBuildVersion\" -ErrorAction SilentlyContinue\r\n\r\n    # Alert if a password is stored in the registry, which might be insecure if in plain text.\r\n    if ($DefaultPassword) {\r\n        Write-Host \"[Alert] A Password is stored in HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\DefaultPassword. This password is likely in plain text.\"\r\n    }\r\n\r\n    # Check if the device is part of a domain, and if so, recommend using group policy for login settings.\r\n    if (Test-IsDomainJoined) {\r\n        Write-Host \"[Error] This device is domain joined. CTRL ALT Delete login should be setup using group policy.\"\r\n        Write-Host \"[Info] Group Policy Location: Computer Configuration &gt; Windows Settings &gt; Security Settings &gt; Local Policies &gt; Security Options &gt; Interactive logon:(...)\"\r\n        Write-Host \"[Info] https:\/\/learn.microsoft.com\/en-us\/previous-versions\/windows\/it-pro\/windows-10\/security\/threat-protection\/security-policy-settings\/interactive-logon-do-not-require-ctrl-alt-del\"\r\n        exit 1\r\n    }\r\n\r\n    # Turn off automatic login if it is enabled.\r\n    if ($AutoLogin -ne 0) {\r\n        Set-RegKey -Path \"Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" -Name \"AutoAdminLogon\" -Value 0\r\n    }\r\n\r\n    # Disable automatic login if it is enabled\r\n    if ($PasswordLessSetting -eq 0) {\r\n        Set-RegKey -Path \"Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\PasswordLess\\Device\" -Name \"DevicePasswordLessBuildVersion\" -Value 2\r\n    }\r\n\r\n    # Announce the start of the security policy retrieval process.\r\n    Write-Host \"Retrieving existing security policy...\"\r\n\r\n    # Export the current security policy and record the output to a temporary file.\r\n    $SecurityPolicyPath = \"$env:TEMP\\enable-ctrlaltdellogin.cfg\"\r\n    $OutputPath = \"$env:TEMP\\enable-ctrlaltdellogin.txt\"\r\n    $ExportPolicy = Start-Process SecEdit.exe -ArgumentList \"\/export \/cfg $SecurityPolicyPath\" -RedirectStandardOutput $OutputPath -NoNewWindow -Wait -PassThru\r\n    $ExportPolicyOutput = Get-Content -Path $OutputPath\r\n\r\n    # Display the output of the policy export and clean up the temporary file.\r\n    if ($ExportPolicyOutput) {\r\n        $ExportPolicyOutput | Write-Host\r\n        Remove-Item $OutputPath\r\n    }\r\n\r\n    # Check the exit code of the export process and display an error message if the export failed.\r\n    if ($ExportPolicy.ExitCode -ne 0) {\r\n        Write-Host -Object \"Exit Code: $($ExportPolicy.ExitCode)\"\r\n        Write-Host -Object \"[Error] Unable to edit security policy.\"\r\n        exit 1\r\n    }\r\n    \r\n    # Check if Microsoft default setting is specifed.\r\n    if ($MicrosoftDefaults) {\r\n        Write-Host \"Removing Ctrl Alt Del requirement from security policy...\"\r\n\r\n        # Initialize a new list to store modified security policy settings.\r\n        $NewSecPolicy = New-Object System.Collections.Generic.List[string]\r\n\r\n        # Read the current security policy and process each line.\r\n        Get-Content $SecurityPolicyPath | ForEach-Object {\r\n\r\n            # If the line contains settings for CTRL ALT DEL, reset the value.\r\n            if ($_ -match \"DisableCAD\") {\r\n                $NewSecPolicy.Add(($_ -replace \",.*\", \",1\"))\r\n            }\r\n            else {\r\n                $NewSecPolicy.Add($_)\r\n            }\r\n        }\r\n\r\n        # Write the modified security policy back to the configuration file.\r\n        $NewSecPolicy | Out-File $SecurityPolicyPath\r\n\r\n        Write-Host \"Applying updated policy...\"\r\n        # Apply the modified security policy using SecEdit.exe.\r\n        $UpdateSecurityPolicy = Start-Process SecEdit.exe -ArgumentList \"\/configure \/db c:\\windows\\security\\local.sdb \/cfg $SecurityPolicyPath\" -RedirectStandardOutput $OutputPath -Wait -NoNewWindow -PassThru\r\n    \r\n        # Capture the output from the policy update and display it.\r\n        $UpdatePolicyOutput = Get-Content -Path $OutputPath\r\n        if ($UpdatePolicyOutput) {\r\n            $UpdatePolicyOutput | Write-Host\r\n            Remove-Item $OutputPath\r\n        }\r\n    \r\n\r\n        # Check the exit code of the policy update process and handle errors.\r\n        if ($UpdateSecurityPolicy.ExitCode -ne 0) {\r\n            Write-Host -Object \"Exit Code: $($UpdateSecurityPolicy.ExitCode)\"\r\n            Write-Host -Object \"[Error] Unable to update security policy.\"\r\n            exit 1\r\n        }\r\n        else {\r\n            if ($ForceRestart) {\r\n                Write-Warning -Message \"Scheduling system restart for 60 seconds from now. $((Get-Date).AddMinutes(60))\"\r\n                Start-Process shutdown.exe -ArgumentList \"\/r \/t 60\" -Wait -NoNewWindow\r\n            }\r\n            else {\r\n                Write-Warning -Message \"A restart may be required for the Ctrl Alt Del requirement to be removed. Please restart at your earliest convenience.\"\r\n            }\r\n            \r\n            exit $ExitCode\r\n        }\r\n    }\r\n\r\n    # Begin modification to require ctrl alt del in the security policy.\r\n    Write-Host \"Modifying policy to require Ctrl Alt Del to be pressed on login.\"\r\n\r\n    # Check if the current policy already includes a ctrl alt del requirement.\r\n    if (Get-Content $SecurityPolicyPath | Where-Object { $_ -like \"*DisableCAD*\" }) {\r\n        # Replace the existing title with a new one, maintaining other parts of the line.\r\n        $Caption = (Get-Content $SecurityPolicyPath | Where-Object { $_ -like \"*DisableCAD*\" }) -replace ',.*', \",0\"\r\n        (Get-Content $SecurityPolicyPath) -replace \".*DisableCAD.*\", \"$Caption\" | Out-File $SecurityPolicyPath\r\n    }\r\n    else {\r\n        # If setting is not present, create a new list for the modified policy settings.\r\n        $NewSecPolicy = New-Object System.Collections.Generic.List[string]\r\n        # Create the new setting.\r\n        $Caption = \"MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\DisableCAD=4,0\"\r\n\r\n        # Read the current policy and add the new setting where appropriate.\r\n        Get-Content $SecurityPolicyPath | ForEach-Object {\r\n            if ($_ -match \"\\[Registry Values\\]\") {\r\n                $NewSecPolicy.Add($_)\r\n                $NewSecPolicy.Add($Caption)\r\n            }\r\n            else {\r\n                $NewSecPolicy.Add($_)\r\n            }\r\n        }\r\n\r\n        # Write the modified settings back to the configuration file.\r\n        $NewSecPolicy | Out-File $SecurityPolicyPath\r\n    }\r\n\r\n    # Display a message indicating that the updated security policy is being applied.\r\n    Write-Host \"Applying updated policy...\"\r\n    $UpdateSecurityPolicy = Start-Process SecEdit.exe -ArgumentList \"\/configure \/db c:\\windows\\security\\local.sdb \/cfg $SecurityPolicyPath \/areas securitypolicy\" -RedirectStandardOutput $OutputPath -Wait -NoNewWindow -PassThru\r\n    \r\n    $UpdatePolicyOutput = Get-Content -Path $OutputPath\r\n    # If there is any output from the SecEdit process, display it in the console.\r\n    if ($UpdatePolicyOutput) {\r\n        $UpdatePolicyOutput | Write-Host\r\n        Remove-Item $OutputPath\r\n    }\r\n    \r\n\r\n    # Check if the SecEdit process completed successfully by examining the exit code.\r\n    if ($UpdateSecurityPolicy.ExitCode -ne 0) {\r\n        Write-Host -Object \"Exit Code: $($UpdateSecurityPolicy.ExitCode)\"\r\n        Write-Host -Object \"[Error] Unable to update security policy.\"\r\n        exit 1\r\n    }\r\n\r\n    if ($ForceRestart) {\r\n        Write-Warning -Message \"Scheduling system restart for 60 seconds from now. $((Get-Date).AddMinutes(60))\"\r\n        Start-Process shutdown.exe -ArgumentList \"\/r \/t 60\" -Wait -NoNewWindow\r\n    }\r\n    else {\r\n        Write-Warning -Message \"A restart may be required for the Ctrl Alt Del requirement to take effect. Please restart at your earliest convenience.\"\r\n    }\r\n    \r\n    exit $ExitCode\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>Gagnez du temps gr\u00e2ce \u00e0 plus de 300 scripts du Dojo NinjaOne.<\/p>\n<p>\u2192 <a class=\"waffle-rich-text-link\" href=\"https:\/\/www.ninjaone.com\/fr\/phase-de-test-gratuit\/\">Obtenir l&rsquo;acc\u00e8s<\/a><\/p>\n<\/div>\n<h2>Comment fonctionne le script<\/h2>\n<h3>1. Contr\u00f4les et fonctions pr\u00e9liminaires<\/h3>\n<ul>\n<li><strong>Privil\u00e8ges d&rsquo;administrateur<\/strong>\u00a0: Le script garantit qu&rsquo;il s&rsquo;ex\u00e9cute avec des privil\u00e8ges \u00e9lev\u00e9s, ce qui est essentiel pour modifier les cl\u00e9s de registre et les strat\u00e9gies de s\u00e9curit\u00e9.<\/li>\n<li><strong>V\u00e9rification du domaine<\/strong>\u00a0: V\u00e9rifie si l&rsquo;appareil est reli\u00e9 \u00e0 un domaine. Pour les machines reli\u00e9es \u00e0 un domaine, il est conseill\u00e9 d&rsquo;utiliser la strat\u00e9gie de groupe plut\u00f4t que de modifier les param\u00e8tres locaux.<\/li>\n<li><strong>Fonctions d&rsquo;assistance<\/strong>\u00a0:<\/li>\n<li>Test-IsDomainJoined d\u00e9termine l&rsquo;appartenance \u00e0 un domaine.<\/li>\n<li>Set-RegKey g\u00e8re les modifications du registre, en s&rsquo;assurant que les cl\u00e9s existent et que les valeurs sont mises \u00e0 jour si n\u00e9cessaire.<\/li>\n<li>Test-IsElevated garantit les droits d&rsquo;administration.<\/li>\n<\/ul>\n<h3>2. Modifications des cl\u00e9s du registre<\/h3>\n<ul>\n<li>Le script d\u00e9sactive\u00a0<strong>AutoAdminLogon<\/strong>\u00a0en d\u00e9finissant sa valeur de registre \u00e0 0. Cela permet de s&rsquo;assurer que les utilisateurs ne peuvent pas contourner l&rsquo;authentification au d\u00e9marrage.<\/li>\n<li>Il ajuste \u00e9galement la valeur de\u00a0<strong>DevicePasswordLessBuildVersion<\/strong>\u00a0pour imposer l&rsquo;utilisation d&rsquo;un mot de passe.<\/li>\n<\/ul>\n<h3>3. Configuration de la strat\u00e9gie de s\u00e9curit\u00e9<\/h3>\n<ul>\n<li>Le script exporte la strat\u00e9gie de s\u00e9curit\u00e9 actuelle \u00e0 l&rsquo;aide de SecEdit.exe et la modifie pour appliquer\u00a0<strong>CTRL+ALT+SUPPR<\/strong>\u00a0comme exigences de connexion.<\/li>\n<li>Si les valeurs par d\u00e9faut de Microsoft sont sp\u00e9cifi\u00e9es, le script r\u00e9initialise le param\u00e8tre\u00a0<strong>DisableCAD<\/strong>\u00a0pour permettre de contourner\u00a0<strong>CTRL+ALT+SUPPR<\/strong>.<\/li>\n<\/ul>\n<h3>4. Application de la strat\u00e9gie<\/h3>\n<ul>\n<li>Apr\u00e8s avoir modifi\u00e9 le fichier de configuration, le script r\u00e9applique la strat\u00e9gie de s\u00e9curit\u00e9 pour que les changements soient effectifs.<\/li>\n<li>Si sp\u00e9cifi\u00e9, il planifie un red\u00e9marrage du syst\u00e8me pour s&rsquo;assurer que les nouveaux param\u00e8tres prennent effet imm\u00e9diatement.<\/li>\n<\/ul>\n<h3>5. Gestion des erreurs et alertes<\/h3>\n<ul>\n<li>Le script v\u00e9rifie les pi\u00e8ges potentiels, tels que les mots de passe stock\u00e9s en texte brut ou les privil\u00e8ges insuffisants, et fournit des retours exploitables.<\/li>\n<\/ul>\n<h2>Applications pratiques pour les professionnels de l&rsquo;informatique<\/h2>\n<h3>Cas d&rsquo;utilisation hypoth\u00e9tique<\/h3>\n<p>Prenons l&rsquo;exemple d&rsquo;un administrateur informatique qui g\u00e8re les postes de travail d&rsquo;une institution financi\u00e8re. Pour se conformer aux r\u00e8gles de s\u00e9curit\u00e9, ils doit imposer\u00a0<strong>CTRL+ALT+SUPPR<\/strong>\u00a0pour la connexion et d\u00e9sactiver la connexion automatique sur 50 appareils. Au lieu de configurer manuellement chaque machine, il utilise ce script PowerShell pour automatiser le processus. Le script s&rsquo;ex\u00e9cute pendant les heures creuses, appliquant les changements de mani\u00e8re uniforme et enregistrant les progr\u00e8s r\u00e9alis\u00e9s \u00e0 des fins de responsabilisation.<\/p>\n<h3>Comparaison du script avec d&rsquo;autres m\u00e9thodes<\/h3>\n<p>Si ce script constitue une solution efficace pour les syst\u00e8mes autonomes, les appareils reli\u00e9s \u00e0 un domaine b\u00e9n\u00e9ficient de la strat\u00e9gie de groupe, qui offre un contr\u00f4le et un audit centralis\u00e9s. Toutefois, pour les syst\u00e8mes hors domaine ou les configurations uniques, le script surpasse les m\u00e9thodes manuelles en raison de ses capacit\u00e9s d&rsquo;automatisation et de v\u00e9rification des erreurs.<\/p>\n<h2>Questions fr\u00e9quemment pos\u00e9es<\/h2>\n<h3>Qestion 1\u00a0: Ce script peut-il \u00eatre utilis\u00e9 sur des syst\u00e8mes reli\u00e9s par des domaines\u00a0?<\/h3>\n<p>Le script le d\u00e9conseille et recommande la strat\u00e9gie de groupe pour une meilleure \u00e9volutivit\u00e9 et une meilleure conformit\u00e9.<\/p>\n<h3>Qestion 2\u00a0: Que se passe-t-il si le script est ex\u00e9cut\u00e9 sans privil\u00e8ges administratifs\u00a0?<\/h3>\n<p>Le script d\u00e9tecte ce sc\u00e9nario et se termine de mani\u00e8re \u00e9l\u00e9gante, en avertissant l&rsquo;utilisateur qu&rsquo;il doit le r\u00e9ex\u00e9cuter avec des autorisations \u00e9lev\u00e9es.<\/p>\n<h3>Qestion 3\u00a0: Les changements prendront-ils effet imm\u00e9diatement\u00a0?<\/h3>\n<p>La plupart des changements s&rsquo;appliquent instantan\u00e9ment, mais il est recommand\u00e9 de red\u00e9marrer le syst\u00e8me pour que l&rsquo;exigence\u00a0<strong>CTRL+ALT+SUPPR<\/strong>\u00a0prenne pleinement effet.<\/p>\n<h3>Qestion 4\u00a0: Comment puis-je annuler les modifications\u00a0?<\/h3>\n<p>Utilisez le param\u00e8tre -MicrosoftDefaults pour r\u00e9initialiser les param\u00e8tres aux valeurs par d\u00e9faut de Microsoft.<\/p>\n<h2>Implications pour la s\u00e9curit\u00e9 informatique<\/h2>\n<p>En imposant\u00a0<strong>CTRL+ALT+SUPPR<\/strong>, les entreprises renforcent leurs d\u00e9fenses contre le vol d&rsquo;informations d&rsquo;identification et les attaques par usurpation d&rsquo;identit\u00e9. La d\u00e9sactivation de la connexion automatique r\u00e9duit le risque d&rsquo;acc\u00e8s non autoris\u00e9, en particulier sur les appareils situ\u00e9s dans des zones partag\u00e9es ou tr\u00e8s fr\u00e9quent\u00e9es. Bien que ce script concerne les configurations locales, il souligne l&rsquo;importance des strat\u00e9gies de s\u00e9curit\u00e9 \u00e0 plusieurs niveaux dans les environnements informatiques.<\/p>\n<h2>Recommandations pour l&rsquo;utilisation du script<\/h2>\n<ol>\n<li><strong>Test dans un environnement contr\u00f4l\u00e9<\/strong>\u00a0: Avant de proc\u00e9der \u00e0 un d\u00e9ploiement \u00e0 grande \u00e9chelle, testez le script pour vous assurer de sa compatibilit\u00e9 et de son efficacit\u00e9.<\/li>\n<li><strong>Modifications du document<\/strong>\u00a0: Conservez des journaux indiquant quand et o\u00f9 le script est appliqu\u00e9 pour r\u00e9f\u00e9rence et audit ult\u00e9rieurs.<\/li>\n<li><strong>Int\u00e9grer l&rsquo;automatisation<\/strong>\u00a0: Utilisez des outils tels que NinjaOne pour planifier et surveiller l&rsquo;ex\u00e9cution des scripts sur plusieurs appareils.<\/li>\n<\/ol>\n<h2>Conclusion<\/h2>\n<p>L&rsquo;automatisation des configurations de s\u00e9curit\u00e9, comme la d\u00e9sactivation de la connexion automatique et l&rsquo;application de\u00a0<strong>CTRL+ALT+SUPPR<\/strong>\u00a0, est une t\u00e2che essentielle pour les professionnels de l&rsquo;informatique. Ce script simplifie le processus, assure la conformit\u00e9 et renforce la s\u00e9curit\u00e9. Pour les besoins plus larges de gestion informatique, des outils tels que\u00a0<strong>NinjaOne<\/strong>\u00a0peuvent rationaliser ces op\u00e9rations, en offrant un contr\u00f4le centralis\u00e9, des rapports et une automatisation permettant de g\u00e9rer <a href=\"https:\/\/www.ninjaone.com\/fr\/efficacite\/\">efficacement<\/a> des environnements complexes.<\/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":[4281],"class_list":["post-391028","script_hub","type-script_hub","status-publish","hentry","script_hub_category-windows","use_cases-configuration-generale"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/script_hub\/391028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/script_hub"}],"about":[{"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/types\/script_hub"}],"author":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/comments?post=391028"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/media?parent=391028"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/operating_system?post=391028"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/use_cases?post=391028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}