{"id":237457,"date":"2024-04-17T11:00:04","date_gmt":"2024-04-17T11:00:04","guid":{"rendered":"https:\/\/www.ninjaone.com\/?post_type=script_hub&#038;p=237457"},"modified":"2024-04-17T11:05:06","modified_gmt":"2024-04-17T11:05:06","slug":"rinominare-il-computer-per-macos","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaonesandbox.dev\/it\/script-hub\/rinominare-il-computer-per-macos\/","title":{"rendered":"Guida allo script: Rinominare automaticamente il nome host locale e il computer per macOS"},"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>Efficienza automatizzata:<\/strong> Lo script rinomina in modo automatico i computer e nomi degli host locali del Mac, migliorando l&#8217;efficienza della gestione della rete.<\/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>Nomi di rete e nomi user-friendly:<\/strong> Fa una distinzione tra il nome user-friendly del computer e il nome dell&#8217;host locale visibile in rete.<\/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>Flessibilit\u00e0 dei parametri:<\/strong> Gli utenti possono scegliere di rinominare il nome dell\u2019host locale, il nome del computer o entrambi.<\/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>Rigorose regole di convalida:<\/strong> Lo script per rinominare il computer per macOS applica gli standard di denominazione, garantendo la conformit\u00e0 alle convenzioni dei nomi host.<\/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>Gestione degli errori:<\/strong> L\u2019efficace gestione degli errori fornisce un feedback chiaro e previene gli ostacoli pi\u00f9 comuni.<\/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>Pulizia della cache DNS:<\/strong> Include un passaggio per svuotare la cache DNS, facilitando il riconoscimento immediato delle modifiche da parte della rete.<\/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>Dipendenza dal rinnovo DHCP:<\/strong> Le modifiche ai nomi potrebbero non propagarsi completamente fino al ciclo di rinnovo DHCP successivo.<\/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>Automazione e processo manuale:<\/strong> Lo script offre un significativo miglioramento dell&#8217;efficienza rispetto al processo di rinominazione manuale.<\/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>Sicurezza e chiarezza:<\/strong> Favorisce il mantenimento di una convenzione di denominazione che favorisca la sicurezza e la chiarezza della rete.<\/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>Integrazione con gli strumenti di gestione:<\/strong> La funzionalit\u00e0 dello script per rinominare il computer per macOS esemplifica il tipo di automazione che pu\u00f2 essere integrata in sistemi di gestione IT come NinjaOne.<\/li>\n<\/ul>\n<p>La modifica del nome del computer e dell&#8217;host locale di un Mac \u00e8 un&#8217;operazione cruciale per i professionisti IT che gestiscono pi\u00f9 dispositivi in rete. Rinominando in modo efficiente questi componenti si pu\u00f2 semplificare la gestione della rete e l&#8217;identificazione dei dispositivi, garantendo un funzionamento perfetto in ambienti IT dinamici.<\/p>\n<h2>Background<\/h2>\n<p>Lo script Bash fornito offre una soluzione solida per rinominare il nome del computer e dell&#8217;host locale di un Mac. Questi elementi sono fondamentali in una configurazione di rete: il nome del computer \u00e8 l&#8217;identificatore user-friendly visibile nel Finder, mentre il nome dell&#8217;host locale viene utilizzato all&#8217;interno della rete. Lo script per rinominare il computer per macOS \u00e8 particolarmente utile per i professionisti IT e i <a href=\"https:\/\/www.ninjaonesandbox.dev\/it\/cos-e-un-msp\/\" target=\"_blank\" rel=\"noopener\">fornitori di servizi gestiti (MSP)<\/a> che devono gestire le identit\u00e0 dei dispositivi in modo coerente ed efficiente.<\/p>\n<h2>Lo script per rinominare il computer per macOS:<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">#!\/bin\/bash\r\n\r\n# Description: Change's both the mac's computername (friendly name seen in Finder) and local hostname (what you would see in the network). Please note the hostname will update upon the next dhcp renewal.\r\n#\r\n# Release Notes: Initial Release\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.ninjaonesandbox.dev\/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#\r\n# Below are all the valid parameters for this script only the new computer name is required!\r\n# Preset Parameter: \"ReplaceWithNewComputerName\" --localhostname-only --computername-only\r\n# --localhostname-only: Sets only the LocalHostName (The one you see when scanning the network)\r\n# --computername-only: Sets only the user-friendly ComputerName (The one you see in finder)\r\n\r\n# Help text function for when invalid input is encountered\r\nprint_help() {\r\n  printf '\\n### Below are all the (case sensitive) valid parameters for this script only the new computer name is required! ###\\n'\r\n  printf '\\nPreset Parameter: \"ReplaceWithNewComputerName\" --localhostname-only --computername-only \\n'\r\n  printf '\\t%s\\n' \"--localhostname-only: Sets only the LocalHostName (The one you see when scanning the network)\"\r\n  printf '\\t%s\\n' \"--computername-only: Sets only the user-friendly ComputerName (The one you see in finder)\"\r\n}\r\n\r\n# Determines whether or not help text is nessessary and routes the output to stderr\r\ndie() {\r\n  local _ret=\"${2:-1}\"\r\n  echo \"$1\" &gt;&amp;2\r\n  test \"${_PRINT_HELP:-no}\" = yes &amp;&amp; print_help &gt;&amp;2\r\n  exit \"${_ret}\"\r\n}\r\n\r\n# THE DEFAULTS INITIALIZATION - OPTIONALS\r\n_arg_localhostname_only=\"off\"\r\n_arg_computername_only=\"off\"\r\n_typical=\"on\"\r\n\r\n# Grabbing the parameters and parsing through them.\r\nparse_commandline() {\r\n  while test $# -gt 0; do\r\n    _key=\"$1\"\r\n    case \"$_key\" in\r\n    --localhostname-only)\r\n      _arg_localhostname_only=\"on\"\r\n      _typical=\"off\"\r\n      ;;\r\n    --computername-only)\r\n      _arg_computername_only=\"on\"\r\n      _typical=\"off\"\r\n      ;;\r\n    --*)\r\n      _PRINT_HELP=yes die \"FATAL ERROR: Got an unexpected argument '$1'\" 1\r\n      ;;\r\n    *)\r\n      if [[ -z $_arg_name ]]; then\r\n        _arg_name=$1\r\n      else\r\n        _PRINT_HELP=yes die \"FATAL ERROR: Got an unexpected argument '$1' but the new computername '$_arg_name' was already specified\" 1\r\n      fi\r\n      ;;\r\n    esac\r\n    shift\r\n  done\r\n}\r\n\r\n# Dtermines if the hostname is valid.\r\nvalidate_localhostname() {\r\n  pattern=\" |'\"\r\n  if [[ $1 =~ $pattern ]]; then\r\n    _PRINT_HELP=yes die \"FATAL ERROR: Local Hostnames DO NOT support spaces or most special characters - is okay!\" 1\r\n  fi\r\n\r\n  if [[ ${#1} -gt 253 ]]; then\r\n    _PRINT_HELP=yes die \"FATAL ERROR: Local Hostnames cannot be more than 253 characters long!\" 1\r\n  fi\r\n\r\n  if [[ ${#1} -gt 15 ]]; then\r\n    printf \"\\nWARNING: Hostname is longer than 15 characters!\"\r\n    printf \"\\tWhile technically osx will let you set a hostname of basically any length you may experience issues if the name is absurdly long.\"\r\n  fi\r\n}\r\n\r\n# Initializes parameter processing\r\nparse_commandline \"$@\"\r\n\r\nif [[ -n $newName ]]; then\r\n  _arg_name=$newName\r\nfi\r\n\r\nif [[ -n $action ]]; then\r\n  if [[ $action == \"Change Local Host Name Only\" ]]; then\r\n    _arg_localhostname_only=\"on\"\r\n    _typical=\"off\"\r\n  fi\r\n  if [[ $action == \"Change Computer Name Only\" ]]; then\r\n    _arg_computername_only=\"on\"\r\n    _typical=\"off\"\r\n  fi\r\nfi\r\n\r\n# If they didn't give me a new name I should error out\r\nif [[ -z $_arg_name ]]; then\r\n  _PRINT_HELP=yes die 'FATAL ERROR: No Computer Name was given! Please enter in the new name in the \"Preset Parameter\" box in Ninja! For Example \"MyNewName\".' 1\r\nfi\r\n\r\n# If they didn't specify which of the 2 names to change we'll change both\r\nif [[ $_typical == \"on\" ]]; then\r\n  validate_localhostname \"$_arg_name\"\r\n  echo \"Changing both LocalHostName and ComputerName to $_arg_name...\"\r\n\r\n  # This actually changes the name\r\n  scutil --set LocalHostName \"$_arg_name\"\r\n  # Sleeps for a few seconds as scutil sometimes takes a second or two for the new name to appear\r\n  sleep 7\r\n  # Tests that the change was successful\r\n  new_localhostname=$(scutil --get LocalHostName)\r\n  if [[ $new_localhostname != \"$_arg_name\" ]]; then\r\n    _PRINT_HELP=no die \"FATAL ERROR: failed to set local hostname to $_arg_name.\" 1\r\n  else\r\n    echo \"Success!\"\r\n  fi\r\n\r\n  # Changes the friendly name\r\n  scutil --set ComputerName \"$_arg_name\"\r\n  # Sleeps for a few seconds as we're gonna test immediately afterwards\r\n  sleep 7\r\n  # Test that we were successful\r\n  new_computername=$(scutil --get ComputerName)\r\n  if [[ $new_localhostname != \"$_arg_name\" ]]; then\r\n    _PRINT_HELP=no die \"FATAL ERROR: failed to set Computer Name to $_arg_name.\" 1\r\n  else\r\n    echo \"Success!\"\r\n  fi\r\n\r\nfi\r\n\r\n# This is the same as above just localhostname only\r\nif [[ $_arg_localhostname_only == \"on\" ]]; then\r\n  validate_localhostname \"$_arg_name\"\r\n  echo \"Changing LocalHostName to $_arg_name...\"\r\n  scutil --set LocalHostName \"$_arg_name\"\r\n  sleep 7\r\n  new_localhostname=$(scutil --get LocalHostName)\r\n  if [[ $new_localhostname != \"$_arg_name\" ]]; then\r\n    _PRINT_HELP=no die \"FATAL ERROR: failed to set local hostname to $_arg_name.\" 1\r\n  else\r\n    echo \"Success!\"\r\n  fi\r\nfi\r\n\r\n# Same as above just friendly name only\r\nif [[ $_arg_computername_only == \"on\" ]]; then\r\n  echo \"Changing ComputerName to $_arg_name...\"\r\n  scutil --set ComputerName \"$_arg_name\"\r\n  sleep 7\r\n  new_computername=$(scutil --get ComputerName)\r\n  if [[ $new_computername != \"$_arg_name\" ]]; then\r\n    _PRINT_HELP=no die \"FATAL ERROR: failed to set Computer Name to $_arg_name.\" 1\r\n  else\r\n    echo \"Success\"\r\n  fi\r\nfi\r\n\r\n# Flushes the dns cache so that the mac is prepared to start handing out its new name\r\ndscacheutil -flushcache\r\n\r\n# Warns the user that it will take some time for the new name to show up\r\nprintf \"\\nWARNING: The devicename in Ninja will likely display the old name until the next dhcp renewal.\"\r\nprintf \"\\n\\tOSX determines its devicename\\hostname from the dhcp or dns server.\"\r\nprintf \"\\n\\tTypically these services will update their records upon receiving a new DHCP request from the device.\"<\/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.ninjaonesandbox.dev\/it\/prova-gratuita\/\">Ottieni l&#8217;accesso<\/a><\/p>\n<\/div>\n<h2>Analisi dettagliata<\/h2>\n<p>Lo script per rinominare il computer per macOS si articola in diverse fasi chiave:<\/p>\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>Gestione dei parametri:<\/strong> Inizia analizzando gli argomenti della riga di comando, consentendo agli utenti di specificare se desiderano modificare il nome dell\u2019host locale, il nome del computer o entrambi.<\/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>Convalida:<\/strong> Include una funzione di convalida per garantire che il nuovo nome sia conforme agli standard dei nomi host, controllando i caratteri proibiti e le restrizioni di lunghezza.<\/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>Modifica del nome:<\/strong> Il comando <strong>scutil<\/strong> viene utilizzato per applicare i nuovi nomi. Dopo ogni modifica, lo script fa una breve pausa per assicurarsi che il sistema riconosca il nuovo nome prima di procedere.<\/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>Gestione degli errori:<\/strong> Lo script per rinominare il computer per macOS gestisce in modo efficace gli errori, fornendo un feedback chiaro in caso di problemi.<\/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>Pulizia della cache DNS:<\/strong> Infine, <a href=\"https:\/\/www.ninjaonesandbox.dev\/script-hub\/dns-cache-clearing-in-macos\/\">svuota la cache DNS<\/a>, assicurando che i nuovi nomi siano immediatamente riconosciuti in tutta la rete.<\/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>Notifica all&#8217;utente:<\/strong> Lo script si conclude ricordando all&#8217;utente che le modifiche potrebbero non essere visibili fino al successivo rinnovo del DHCP.<\/li>\n<\/ul>\n<h2>Casi d&#8217;uso potenziali<\/h2>\n<p>Immagina che un professionista IT di una scuola abbia bisogno di rinominare i Mac in un laboratorio informatico per facilitarne la gestione. Utilizzando questo script, \u00e8 possibile aggiornare in modo efficiente l&#8217;identit\u00e0 di ogni macchina, garantendo una convenzione di denominazione coerente in tutta la rete.<\/p>\n<h2>Confronti<\/h2>\n<p>Normalmente rinominare i Mac richiede un intervento manuale attraverso le Preferenze di Sistema, che richiede molto tempo ed \u00e8 soggetto a errori. Lo script automatizza il processo, riducendo la probabilit\u00e0 di errori e facendo risparmiare molto tempo.<\/p>\n<h2>Domande frequenti<\/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=\"7\" data-aria-level=\"1\"><strong>Come si utilizza lo script per rinominare il computer per macOS?<\/strong>\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=\"7\" data-aria-level=\"1\">\u00c8 sufficiente eseguire lo script con il nuovo nome come argomento, specificando facoltativamente il tipo di nome da modificare.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\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=\"8\" data-aria-level=\"1\"><strong>\u00c8 possibile rinominare una macchina con un nome contenente caratteri speciali?<\/strong>\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=\"8\" data-aria-level=\"1\">No, lo script convalida il nome per assicurarsi che sia conforme agli standard dei nomi host.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\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=\"9\" data-aria-level=\"1\"><strong>I cambiamenti saranno immediati?<\/strong>\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=\"9\" data-aria-level=\"1\">Lo script esegue la pulizia della cache DNS, ma alcune modifiche potrebbero essere visualizzate solo dopo il successivo rinnovo del DHCP.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Implicazioni<\/h2>\n<p>L&#8217;automazione del processo di rinominazione riduce al minimo gli errori umani e semplifica la gestione della rete. Tuttavia, \u00e8 fondamentale mantenere una convenzione di denominazione che migliori la sicurezza e la chiarezza della rete.<\/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\">Effettua sempre un backup delle impostazioni del sistema prima di eseguire tali script.<\/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\">Utilizza convenzioni di denominazione chiare e coerenti.<\/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\">Testa lo script per rinominare il computer per macOS in un ambiente controllato prima della distribuzione su larga scala.<\/li>\n<\/ul>\n<h2><strong>Considerazioni finali\u00a0<\/strong><\/h2>\n<p>Nel contesto di strumenti come NinjaOne, lo script per rinominare il computer per macOS esemplifica il tipo di <a href=\"https:\/\/www.ninjaonesandbox.dev\/it\/efficienza-it\/\">soluzione efficiente e automatizzata<\/a> che \u00e8 essenziale per la gestione IT moderna. Le funzionalit\u00e0 di NinjaOne possono integrare tali <a href=\"https:\/\/www.ninjaonesandbox.dev\/it\/script-hub\/\" target=\"_blank\" rel=\"noopener\">script<\/a>, offrendo un approccio completo alla gestione dei dispositivi e della rete. L&#8217;integrazione di tale <a href=\"https:\/\/www.ninjaonesandbox.dev\/it\/rmm\/automazione-it\/\">automazione<\/a> all&#8217;interno di strutture di gestione IT pi\u00f9 ampie \u00e8 fondamentale per mantenere ambienti IT affidabili, sicuri ed efficienti.<\/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":[4210],"use_cases":[4269],"class_list":["post-237457","script_hub","type-script_hub","status-publish","hentry","script_hub_category-macos"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaonesandbox.dev\/it\/wp-json\/wp\/v2\/script_hub\/237457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ninjaonesandbox.dev\/it\/wp-json\/wp\/v2\/script_hub"}],"about":[{"href":"https:\/\/www.ninjaonesandbox.dev\/it\/wp-json\/wp\/v2\/types\/script_hub"}],"author":[{"embeddable":true,"href":"https:\/\/www.ninjaonesandbox.dev\/it\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ninjaonesandbox.dev\/it\/wp-json\/wp\/v2\/comments?post=237457"}],"wp:attachment":[{"href":"https:\/\/www.ninjaonesandbox.dev\/it\/wp-json\/wp\/v2\/media?parent=237457"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaonesandbox.dev\/it\/wp-json\/wp\/v2\/operating_system?post=237457"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaonesandbox.dev\/it\/wp-json\/wp\/v2\/use_cases?post=237457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}