{"id":216210,"date":"2024-03-18T11:26:38","date_gmt":"2024-03-18T11:26:38","guid":{"rendered":"https:\/\/www.ninjaone.com\/?post_type=script_hub&#038;p=216210"},"modified":"2024-03-18T11:26:38","modified_gmt":"2024-03-18T11:26:38","slug":"comment-renommer-les-ordinateurs-windows-avec-powershell","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/fr\/script-hub\/comment-renommer-les-ordinateurs-windows-avec-powershell\/","title":{"rendered":"Comment renommer les ordinateurs Windows avec PowerShell"},"content":{"rendered":"<h2>Principaux points \u00e0 retenir<\/h2>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Flexibilit\u00e9 des scripts PowerShell<\/strong>: Ce script illustre la puissance et la flexibilit\u00e9 de PowerShell dans la gestion des param\u00e8tres d&rsquo;ordinateur, soulignant l&rsquo;importance de PowerShell dans l&rsquo;administration informatique moderne.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Facilit\u00e9 de changement du nom des ordinateurs<\/strong>: Souligne la facilit\u00e9 avec laquelle les professionnels de l&rsquo;informatique peuvent renommer les ordinateurs appartenant ou non \u00e0 un domaine.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Identifiants d&rsquo;administrateur de domaine<\/strong>: Souligne la n\u00e9cessit\u00e9 de disposer d&rsquo;identifiants d&rsquo;administrateur de domaine pour renommer des machines reli\u00e9es \u00e0 un domaine, \u00e0 moins qu&rsquo;elles ne soient ex\u00e9cut\u00e9es par un administrateur de domaine.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Option de red\u00e9marrage automatique<\/strong>: Le script comprend une fonction optionnelle de red\u00e9marrage automatique, qui est cruciale pour que les changements aient lieu.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Questions relatives \u00e0 la s\u00e9curit\u00e9<\/strong>\u00a0: Souligne l&rsquo;importance d&rsquo;un traitement s\u00e9curis\u00e9 des informations d&rsquo;identification dans les scripts, comme le montre la conversion des mots de passe en texte clair en cha\u00eenes de caract\u00e8res s\u00e9curis\u00e9es.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Traitement des erreurs et validation<\/strong>: Le script int\u00e8gre une gestion des erreurs et une v\u00e9rification performantes, garantissant une ex\u00e9cution s\u00fbre et fiable.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Application dans le monde r\u00e9el<\/strong>: Illustre des cas d&rsquo;utilisation pratiques, en particulier pour les professionnels de l&rsquo;informatique et les fournisseurs de services g\u00e9r\u00e9s (MSP), afin de simplifier les t\u00e2ches de gestion informatique.<\/li>\n<\/ul>\n<p>La <a href=\"https:\/\/www.ninjaone.com\/fr\/gestion-informatique-grande-entreprise\/infrastructure\/\">gestion efficace de l&rsquo;infrastructure informatique<\/a> est essentielle au bon fonctionnement des entreprises modernes. Parmi de nombreuses t\u00e2ches, renommer les ordinateurs, en particulier dans un environnement de domaine, peut s&rsquo;av\u00e9rer crucial pour maintenir l&rsquo;organisation du syst\u00e8me, respecter les conventions de d\u00e9nomination et garantir les protocoles de s\u00e9curit\u00e9. Les scripts PowerShell se sont impos\u00e9s comme des outils puissants pour automatiser ces t\u00e2ches, en offrant pr\u00e9cision, rapidit\u00e9 et \u00e9volutivit\u00e9.<\/p>\n<h2>Contexte<\/h2>\n<p>Le script PowerShell que nous explorons est con\u00e7u pour renommer les ordinateurs de fa\u00e7on automatis\u00e9e. Cette capacit\u00e9 est particuli\u00e8rement pr\u00e9cieuse 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> qui g\u00e8rent de grands r\u00e9seaux avec de nombreuses machines. Il r\u00e9pond au besoin d&rsquo;une approche coh\u00e9rente et sans erreur du renommage, ce qui est crucial dans les environnements o\u00f9 les noms des ordinateurs sont souvent align\u00e9s sur des r\u00f4les sp\u00e9cifiques, des d\u00e9partements ou des politiques d&rsquo;utilisation.<\/p>\n<h2>Le script :<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">#Requires -Version 5.1\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    Renames either domain-joined or non-domain-joined machines. Requires a Domain Admin's username and password for domain-joined computers, unless run as a Domain Admin.\r\n.DESCRIPTION\r\n    Renames either domain-joined or non-domain-joined machines. Requires a Domain Admin's username and password for domain-joined computers, unless run as a Domain Admin.\r\n.EXAMPLE\r\n    -NewName \"ReplaceWithNewName\"\r\n\r\n    WARNING: The changes will take effect after you restart the computer KYLE-WIN10-TEST.\r\n\r\n    HasSucceeded OldComputerName           NewComputerName          \r\n    ------------ ---------------           ---------------          \r\n    True         KYLE-WIN10-TEST           ReplaceWithNewName               \r\n\r\n\r\n\r\n    WARNING: This script takes effect after a reboot. Use -Reboot to have this script reboot for you.\r\n\r\nPARAMETER: -DomainUser \"UsernameForDomainAdmin\" -DomainPassword \"SuperSecretPassword1\"\r\n    Domain Joined machines require a domain admins creds when not ran as a Domain Admin (System is not a Domain Admin).\r\n\r\nPARAMETER: -Reboot\r\n    Reboots the computer 5 minutes after the script is ran.\r\n.EXAMPLE\r\n    -NewName \"ReplaceWithNewName\" -Reboot\r\n\r\n    This is a domain joined machine. Testing for secure domain connection...\r\n    WARNING: The changes will take effect after you restart the computer KYLE-WIN10-TEST.\r\n\r\n    HasSucceeded OldComputerName           NewComputerName          \r\n    ------------ ---------------           ---------------          \r\n    True         KYLE-WIN10-TEST           ReplaceWithNewName               \r\n\r\n    WARNING: Reboot specified scheduling reboot for 06\/13\/2023 12:09:53...\r\n\r\n.OUTPUTS\r\n    None\r\n.NOTES\r\n    OS: Win 10+, Server 2016+\r\n    Release: 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\/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#&gt;\r\n\r\n[CmdletBinding()]\r\nparam (\r\n    [Parameter()]\r\n    [String]$NewName,\r\n    [Parameter()]\r\n    [String]$DomainUser,\r\n    [Parameter()]\r\n    [String]$DomainPassword,\r\n    [Parameter()]\r\n    [Switch]$Reboot = [System.Convert]::ToBoolean($env:reboot)\r\n)\r\n\r\nbegin {\r\n    # If script forms are used overwrite the params with those values.\r\n    if ($env:newComputerName -and $env:newComputerName -notlike \"null\") { $NewName = $env:newComputerName }\r\n    if ($env:domainAdminUsername -and $env:domainAdminUsername -notlike \"null\") { $DomainUser = $env:domainAdminUsername }\r\n    if ($env:domainAdminPassword -and $env:domainAdminPassword -notlike \"null\") { \r\n        $DomainPassword = $env:domainAdminPassword\r\n        # We should overwrite the environmental variable with a secure string \r\n        $env:domainAdminPassword = $env:domainAdminPassword | ConvertTo-SecureString -AsPlainText -Force \r\n    }\r\n\r\n    # Converts the username and password into a powershell credential object\r\n    if ($DomainUser -and $DomainPassword) {\r\n        $Credential = New-Object System.Management.Automation.PsCredential(\"$DomainUser\", $($DomainPassword | ConvertTo-SecureString -AsPlainText -Force))\r\n    }\r\n\r\n    # If a domain password was given we should overwrite it with a secure string\r\n    if ($DomainPassword) {\r\n        $DomainPassword = $DomainPassword | ConvertTo-SecureString -AsPlainText -Force\r\n    }\r\n\r\n    # Checks if script is running as an elevated user\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    # Check if machine is domain joined\r\n    function Test-IsDomainJoined {\r\n        return $(Get-CimInstance -Class Win32_ComputerSystem).PartOfDomain\r\n    }\r\n\r\n    # Check if script is running as System\r\n    function Test-IsSystem {\r\n        $id = [System.Security.Principal.WindowsIdentity]::GetCurrent()\r\n        return $id.Name -like \"NT AUTHORITY*\" -or $id.IsSystem\r\n    }\r\n\r\n    # Check if script is running as a domain admin\r\n    function Test-IsDomainAdmin {\r\n        $id = [System.Security.Principal.WindowsIdentity]::GetCurrent()\r\n        $p = New-Object System.Security.Principal.WindowsPrincipal($id)\r\n        return $p.IsInRole(\"Domain Admins\")\r\n    }\r\n\r\n    # Double check that this script has something to do.\r\n    if ($NewName -eq $env:computername) {\r\n        Write-Error \"[Error] New name is the same as the current hostname.\"\r\n        exit 1\r\n    }\r\n\r\n    # Error out if not provided with a new name\r\n    if (-not $Newname) {\r\n        Write-Error \"[Error] Please specify a name with the NewName parameter!\"\r\n        exit 1\r\n    }\r\n}\r\nprocess {\r\n    # If not running as the system user script needs to be running as an elevated user.\r\n    if (-not (Test-IsElevated) -and -not (Test-IsSystem)) {\r\n        Write-Error -Message \"Access Denied. Please run with Administrator privileges.\"\r\n        exit 1\r\n    }\r\n\r\n    # Warn end-users if theyre giving the computer too long of a name.\r\n    if ($NewName.Length -gt 15) {\r\n        Write-Warning -Message \"The New Computer Name $NewName exceeds 15 characters! In some instances you may only see the first 15 characters.\"\r\n    }\r\n\r\n    # Preparing Splat\r\n    $ArgumentList = @{\r\n        \"ComputerName\" = $env:computername\r\n        \"Force\"        = $True\r\n        \"NewName\"      = $NewName\r\n        \"PassThru\"     = $True\r\n    }\r\n\r\n    # If it's domain joined we'll have to check a couple things to make sure this is possible\r\n    if (Test-IsDomainJoined) {\r\n        Write-Host -Object \"This is a domain joined machine. Testing for secure domain connection...\"\r\n\r\n        # The domain controller will need to be reachable for the rename to apply\r\n        if (-not (Test-ComputerSecureChannel -ErrorAction Ignore)) {\r\n            Write-Error -Message \"[Error] A secure connection to the domain controller cannot be established!\r\n            Please ensure the domain is reachable and there are no machines with identical names!\"\r\n            exit 1\r\n        }\r\n\r\n        # Domain joined machines require a domain admin to change the name\r\n        if (-not $Credential -and -not (Test-IsDomainAdmin)) {\r\n            Write-Error -Message \"[Error] The -DomainUser and -DomainPassword parameter is missing. \r\n            The username and password for a domain admin is required when not ran as a Domain Admin for domain joined machines!\"\r\n            exit 1\r\n        }\r\n\r\n        # Adding credentials to the splat\r\n        if ($Credential) {\r\n            $ArgumentList[\"DomainCredential\"] = $Credential\r\n        }\r\n    }\r\n\r\n    # Saving the results to check later\r\n    $Result = Rename-Computer @ArgumentList\r\n\r\n    # Letting the end-user know the result\r\n    $Result | Format-Table | Out-String | Write-Host\r\n\r\n    # Error out on failure\r\n    if (-not $Result.HasSucceeded) {\r\n        Write-Error -Message \"[Error] Failed to rename computer!\"\r\n        exit 1\r\n    }\r\n\r\n    # If a reboot was specified schedule it for 5 minutes from now.\r\n    if ($Reboot) {\r\n        Write-Warning -Message \"Reboot specified scheduling reboot for $((Get-Date).AddMinutes(5))...\"\r\n        Start-Process -FilePath \"cmd.exe\" -ArgumentList \"\/C shutdown.exe \/r \/t 300\"\r\n    }\r\n    else {\r\n        Write-Warning -Message \"This script takes effect after a reboot. Use -Reboot to have this script reboot for you.\"\r\n    }\r\n    exit 0\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;\">Acc\u00e9dez \u00e0 plus de 700\u00a0scripts dans le Dojo NinjaOne<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.ninjaone.com\/fr\/phase-de-test-gratuit\/\">Obtenir l&rsquo;acc\u00e8s<\/a><\/p>\n<\/div>\n<h2>Description d\u00e9taill\u00e9e<\/h2>\n<p>Ce script automatise le processus de renommage des ordinateurs Windows, qu&rsquo;ils soient li\u00e9s ou non \u00e0 un domaine. En voici la description \u00e9tape par \u00e9tape\u00a0:<\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>D\u00e9claration des param\u00e8tres<\/strong>: Le script commence par d\u00e9clarer des param\u00e8tres tels que <strong>NewName<\/strong>, <strong>DomainUser<\/strong>, <strong>DomainPassword<\/strong> et <strong>Reboot<\/strong>. Ces entr\u00e9es d\u00e9terminent le nouveau nom de l&rsquo;ordinateur, les informations d&rsquo;identification du domaine et la n\u00e9cessit\u00e9 ou non de red\u00e9marrer la machine apr\u00e8s le changement de nom.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>V\u00e9rifications initiales et traitement des identifiants<\/strong>: Il v\u00e9rifie les variables d&rsquo;environnement et convertit les mots de passe en clair en cha\u00eenes de caract\u00e8res s\u00e9curis\u00e9es. Pour les op\u00e9rations de domaine, il transforme les informations d&rsquo;identification de l&rsquo;utilisateur en un objet &lsquo;credential&rsquo; de PowerShell.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Fonctions<\/strong>: Plusieurs fonctions sont d\u00e9finies pour v\u00e9rifier si le script s&rsquo;ex\u00e9cute avec des privil\u00e8ges \u00e9lev\u00e9s, si l&rsquo;ordinateur fait partie d&rsquo;un domaine, s&rsquo;il s&rsquo;ex\u00e9cute en tant qu&rsquo;utilisateur syst\u00e8me et si l&rsquo;utilisateur est un administrateur domaine.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Validation<\/strong>\u00a0: Le script v\u00e9rifie qu&rsquo;un nouveau nom est fourni et qu&rsquo;il est diff\u00e9rent du nom actuel. Il v\u00e9rifie \u00e9galement les privil\u00e8ges d&rsquo;administrateur et la connectivit\u00e9 au domaine, le cas \u00e9ch\u00e9ant.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Ex\u00e9cution<\/strong>: Si toutes les v\u00e9rifications sont bonnes, la cmdlet <strong>Rename-Computer<\/strong> est appel\u00e9e avec les param\u00e8tres appropri\u00e9s. Cette cmdlet est la commande principale qui ex\u00e9cute le processus de renommage.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Gestion du red\u00e9marrage<\/strong>: Si l&rsquo;option <strong>-Reboot<\/strong> est utilis\u00e9e, le script planifie un red\u00e9marrage du syst\u00e8me dans 5 minutes pour appliquer les modifications.<\/li>\n<\/ul>\n<h2>Cas d&rsquo;utilisation potentiels<\/h2>\n<p>Imaginez qu&rsquo;une entreprise MSP g\u00e8re le r\u00e9seau d&rsquo;une grande organisation qui restructure ses services. L&rsquo;entreprise MSP utilise ce script pour renommer efficacement les ordinateurs \u00e0 travers le r\u00e9seau afin de refl\u00e9ter la nouvelle structure d\u00e9partementale, assurant ainsi la conformit\u00e9 et r\u00e9duisant le travail manuel.<\/p>\n<h2>Comparaisons<\/h2>\n<p>Les m\u00e9thodes traditionnelles de renommage des ordinateurs impliquent souvent une intervention manuelle, par le biais des propri\u00e9t\u00e9s du syst\u00e8me ou des outils du contr\u00f4leur de domaine. Ce script offre une approche plus rationnelle et plus r\u00e9sistante aux erreurs, particuli\u00e8rement utile lorsqu&rsquo;il s&rsquo;agit de g\u00e9rer plusieurs machines.<\/p>\n<h2>FAQ<\/h2>\n<p><strong>Q1 : Ce script peut-il renommer un grand groupe d&rsquo;ordinateurs ?<\/strong><br \/>\nR\u00a0: Oui, mais vous devrez peut-\u00eatre le modifier pour qu&rsquo;il passe en boucle par une liste d&rsquo;ordinateurs et leurs nouveaux noms.<\/p>\n<p><strong>Q2 : Est-il s\u00fbr d&rsquo;utiliser des mots de passe en texte clair dans le script ?<\/strong><br \/>\nR\u00a0: Le script convertit les mots de passe en texte clair en cha\u00eenes de caract\u00e8res s\u00e9curis\u00e9es, ce qui renforce la s\u00e9curit\u00e9. Toutefois, il est recommand\u00e9 de manipuler les informations d&rsquo;identification avec prudence.<\/p>\n<p><strong>Q3 : Ai-je besoin de droits d&rsquo;administrateur pour ex\u00e9cuter ce script ?<\/strong><br \/>\nR\u00a0: Oui, des droits d&rsquo;administrateur sont n\u00e9cessaires, en particulier pour renommer les ordinateurs reli\u00e9s \u00e0 un domaine.<\/p>\n<h2>Implications<\/h2>\n<p>Bien que ce script simplifie une t\u00e2che de routine, une utilisation incorrecte peut entra\u00eener des conflits de noms, des probl\u00e8mes de r\u00e9seau ou des vuln\u00e9rabilit\u00e9s en mati\u00e8re de s\u00e9curit\u00e9. Il est essentiel de planifier et de revoir les strat\u00e9gies de renommage pour s&rsquo;assurer qu&rsquo;elles sont conformes aux strat\u00e9gies de l&rsquo;organisation et aux normes de l&rsquo;infrastructure informatique.<\/p>\n<h2>Recommandations<\/h2>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Effectuer des tests approfondis<\/strong>\u00a0: Ex\u00e9cutez le script dans un environnement de test avant de le d\u00e9ployer dans la production.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>S\u00e9curiser les informations d&rsquo;identification<\/strong>: Traitez et stockez les informations d&rsquo;identification en toute s\u00e9curit\u00e9, de pr\u00e9f\u00e9rence en utilisant des m\u00e9thodes chiffr\u00e9es.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Modifications du document<\/strong>\u00a0: Conservez un enregistrement des modifications \u00e0 des fins de d\u00e9pannage et d&rsquo;audit.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>Dans le domaine de la gestion informatique, des outils comme NinjaOne offrent des <a href=\"https:\/\/www.ninjaone.com\/fr\/rmm\/automatisation-informatique\/\">solutions compl\u00e8tes pour la gestion et l&rsquo;automatisation des t\u00e2ches informatiques<\/a>. L&rsquo;int\u00e9gration de ces scripts dans un cadre de gestion plus large tel que NinjaOne permet <a href=\"https:\/\/www.ninjaone.com\/fr\/efficacite\/\">d&rsquo;am\u00e9liorer l&rsquo;efficacit\u00e9<\/a>, de r\u00e9duire les erreurs et d&rsquo;assurer un meilleur contr\u00f4le des environnements informatiques. En tirant parti de la puissance de <a href=\"https:\/\/www.ninjaone.com\/fr\/\">l&rsquo;automatisation et de la gestion centralis\u00e9e<\/a>, les professionnels de l&rsquo;informatique peuvent se concentrer sur des initiatives strat\u00e9giques plut\u00f4t que sur des t\u00e2ches de routine.<\/p>\n","protected":false},"author":35,"featured_media":192835,"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":[4287],"class_list":["post-216210","script_hub","type-script_hub","status-publish","has-post-thumbnail","hentry","script_hub_category-windows","use_cases-configuration-de-systeme"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/script_hub\/216210","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=216210"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/media\/192835"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/media?parent=216210"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/operating_system?post=216210"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/use_cases?post=216210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}