{"id":387239,"date":"2024-12-02T16:19:04","date_gmt":"2024-12-02T16:19:04","guid":{"rendered":"https:\/\/www.ninjaone.com\/?post_type=script_hub&#038;p=387239"},"modified":"2024-12-02T16:25:55","modified_gmt":"2024-12-02T16:25:55","slug":"notificar-concesiones-dhcp","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/es\/script-hub\/notificar-concesiones-dhcp\/","title":{"rendered":"Gu\u00eda completa para supervisar las concesiones DHCP con PowerShell"},"content":{"rendered":"<p>\u00bfTe gustar\u00eda tener m\u00e1s informaci\u00f3n sobre <strong>las notificaciones de concesiones DHCP<\/strong> para PowerShell? Este art\u00edculo explicar\u00e1 por qu\u00e9 la supervisi\u00f3n y gesti\u00f3n de las concesiones DHCP es una tarea cr\u00edtica para los profesionales de TI y los <a href=\"https:\/\/www.ninjaone.com\/es\/que-es-un-msp\" target=\"_blank\" rel=\"noopener\">proveedores de servicios gestionados (MSP)<\/a>. Asegurarse de que los servidores DHCP funcionan eficazmente y de que hay suficientes <a href=\"https:\/\/www.ninjaone.com\/it-hub\/it-service-management\/what-is-an-ip-address\/\" target=\"_blank\" rel=\"noopener\">direcciones IP<\/a> disponibles en el pool puede evitar problemas de red y garantizar una conectividad eficaz.<\/p>\n<p>Este post profundiza en un script PowerShell dise\u00f1ado para supervisar las concesiones DHCP, alertando a los administradores cuando el n\u00famero de concesiones disponibles cae por debajo de un umbral especificado. Este script es una herramienta esencial para mantener la fiabilidad de la red y evitar posibles interrupciones.<\/p>\n<h2>Contexto<\/h2>\n<p><a href=\"https:\/\/www.ninjaone.com\/es\/it-hub\/it-service-management\/que-es-el-dhcp\/\" target=\"_blank\" rel=\"noopener\">El Protocolo de Configuraci\u00f3n Din\u00e1mica de Host (DHCP)<\/a> es un protocolo de gesti\u00f3n de red utilizado para automatizar el proceso de configuraci\u00f3n de dispositivos en redes IP. Sin el DHCP, habr\u00eda que asignar manualmente una direcci\u00f3n IP a cada dispositivo de la red. Dada la naturaleza din\u00e1mica de las redes modernas, los servidores DHCP suelen estar sometidos a una demanda constante para proporcionar direcciones IP.<\/p>\n<p>Es crucial supervisar estos servidores y asegurarse de que disponen de suficientes contratos de alquiler. El script PowerShell proporcionado responde a esta necesidad comprobando los \u00e1mbitos DHCP y alertando a los administradores si el n\u00famero de concesiones libres cae por debajo de un determinado umbral.<\/p>\n<h2>El script<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">#Requires -Version 5.1\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    Checks the DHCP scopes for the number of leases used and alerts if the threshold is exceeded.\r\n.DESCRIPTION\r\n    Checks the DHCP scopes for the number of leases used and alerts if the threshold is exceeded.\r\n    This script requires the DhcpServer module to be installed with the DHCP server feature installed.\r\n    The script will output the number of leases used, free, and total for each scope.\r\n    If the LeaseThreshold parameter is set, the script will alert if the number of free leases is less than the threshold.\r\n    If the ExcludeScope parameter is set, the script will exclude the specified scope from the output.\r\n    If the IncludeScope parameter is set, the script will only include the specified scope in the output.\r\n\r\n.PARAMETER LeaseThreshold\r\n    The number of free leases that will trigger an alert. If the number of free leases is less than the threshold, an alert will be triggered.\r\n.PARAMETER ExcludeScope\r\n    The name of the scope to exclude from the output.\r\n.PARAMETER IncludeScope\r\n    The name of the scope to include in the output.\r\n\r\n.EXAMPLE\r\n    (No Parameters)\r\n    ## EXAMPLE OUTPUT WITHOUT PARAMS ##\r\n    [Info] Scope: Test1 Leases Used(In Use\/Total): 250\/252\r\n    [Info] Scope: Test2 Leases Used(In Use\/Total): 220\/252\r\n    [Info] Scope: Test6 Leases Used(In Use\/Total): 4954378\/18446744073709551615\r\n\r\n.EXAMPLE\r\n    PARAMETER: -LeaseThreshold 10\r\n    ## EXAMPLE OUTPUT WITH LEASETHRESHOLD ##\r\n    [Alert] Scope: Test1 Leases Used(In Use\/Free\/Total): 220\/2\/252\r\n    [Info] Scope: Test2 Leases Used(In Use\/Free\/Total): 150\/102\/252\r\n    [Info] Scope: Test6 Leases Used(In Use\/Free\/Total): 0\/18446744073709551615\/18446744073709551615\r\n\r\n.EXAMPLE\r\n    PARAMETER: -ExcludeScope \"Test1\"\r\n    ## EXAMPLE OUTPUT WITH EXCLUDESCOPE ##\r\n    [Info] Scope: Test2 Leases Used(In Use\/Free\/Total): 220\/2\/252\r\n    [Info] Scope: Test6 Leases Used(In Use\/Free\/Total): 0\/18446744073709551615\/18446744073709551615\r\n\r\n.EXAMPLE\r\n    PARAMETER: -IncludeScope \"Test2\"\r\n    ## EXAMPLE OUTPUT WITH INCLUDESCOPE ##\r\n    [Info] Scope: Test2 Leases Used(In Use\/Free\/Total): 220\/2\/252\r\n.NOTES\r\n    Minimum OS: Windows Server 2016\r\n    Requires the DhcpServer module to be installed with the DHCP server feature installed.\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\/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    $LeaseThreshold,\r\n    [string[]]$ExcludeScope,\r\n    [string[]]$IncludeScope\r\n)\r\n\r\nbegin {\r\n    function Test-IsElevated {\r\n        # check if running under a Pester test case\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    try {\r\n        if ($env:leaseThreshold -and $env:leaseThreshold -notlike \"null\") {\r\n            [int]$LeaseThreshold = $env:leaseThreshold\r\n        }\r\n    }\r\n    catch {\r\n        Write-Host \"[Error] LeaseThreshold must be a number\"\r\n        exit 2\r\n    }\r\n    \r\n    if ($env:excludeScope -and $env:excludeScope -notlike \"null\") {\r\n        $ExcludeScope = $env:excludeScope\r\n    }\r\n    if ($env:includeScope -and $env:includeScope -notlike \"null\") {\r\n        $IncludeScope = $env:includeScope\r\n    }\r\n\r\n    # Split the ExcludeScope and IncludeScope parameters into an array\r\n    if (-not [String]::IsNullOrWhiteSpace($ExcludeScope) -and $ExcludeScope -like '*,*') {\r\n        $ExcludeScope = $ExcludeScope -split ',' | ForEach-Object { $_.Trim() } | Where-Object { -not [String]::IsNullOrWhiteSpace($_) } | Sort-Object -Unique\r\n    }\r\n    if (-not [String]::IsNullOrWhiteSpace($IncludeScope) -and $IncludeScope -like '*,*') {\r\n        $IncludeScope = $IncludeScope -split ',' | ForEach-Object { $_.Trim() } | Where-Object { -not [String]::IsNullOrWhiteSpace($_) } | Sort-Object -Unique\r\n    }\r\n\r\n    # Check if $ExcludeScope and $IncludeScope contain similar items\r\n    if (-not [String]::IsNullOrWhiteSpace($ExcludeScope) -and -not [String]::IsNullOrWhiteSpace($IncludeScope)) {\r\n        $SimilarItems = $ExcludeScope | Where-Object { $IncludeScope -contains $_ }\r\n        if ($SimilarItems) {\r\n            Write-Host \"[Error] The following scopes are in both ExcludeScope and IncludeScope: $($SimilarItems -join ', ')\"\r\n            exit 2\r\n        }\r\n    }\r\n\r\n    $ShouldAlert = $false\r\n}\r\nprocess {\r\n    if (-not (Test-IsElevated)) {\r\n        Write-Host \"[Error] Access Denied. Please run with Administrator privileges.\"\r\n        exit 2\r\n    }\r\n\r\n    # Check if the DhcpServer module is installed\r\n    if (-not (Get-Module -ListAvailable -Name DhcpServer -ErrorAction SilentlyContinue)) {\r\n        Write-Host \"[Error] The DhcpServer module is not installed. Please install the DHCP server feature and the DhcpServer module.\"\r\n        exit 2\r\n    }\r\n\r\n    # Get all DHCP scopes\r\n    $AllScopes = $(\r\n        Get-DhcpServerv4Scope | Select-Object -ExpandProperty Name\r\n        Get-DhcpServerv6Scope | Select-Object -ExpandProperty Name\r\n    )\r\n\r\n    # Output an error if the ExcludeScope or IncludeScope parameters contain invalid scope names\r\n    $(\r\n        if ($IncludeScope) { $IncludeScope }\r\n        if ($ExcludeScope) { $ExcludeScope }\r\n    ) | ForEach-Object {\r\n        if ($_ -notin $AllScopes) {\r\n            Write-Host \"[Error] Scope: $_ does not exist in the DHCP server. Please check the scope name and try again.\"\r\n        }\r\n    }\r\n\r\n    # IPv4\r\n    # Get all DHCP scopes\r\n    $v4scopes = Get-DhcpServerv4Scope | Where-Object { $_.State }\r\n\r\n    # Iterate through each scope\r\n    foreach ($scope in $v4scopes) {\r\n        # Get statistics for the scope\r\n        $Stats = Get-DhcpServerv4ScopeStatistics -ScopeId $scope.ScopeId\r\n\r\n        # Get the name of the scope\r\n        $Name = (Get-DhcpServerv4Scope -ScopeId $scope.ScopeId).Name\r\n\r\n        # Check if the scope should be excluded\r\n        if (-not [String]::IsNullOrWhiteSpace($ExcludeScope) -and $Name -in $ExcludeScope) {\r\n            continue\r\n        }\r\n\r\n        # Check if the scope should be included\r\n        if (-not [String]::IsNullOrWhiteSpace($IncludeScope) -and $Name -notin $IncludeScope) {\r\n            continue\r\n        }\r\n\r\n        # Check if the number of free leases is less than the threshold\r\n        if ($Stats.Free -lt $LeaseThreshold ) {\r\n            if ($ShouldAlert -eq $false) {\r\n                # Output once if this is the first scope to trigger an alert\r\n                Write-Host \"[Alert] Available DHCP Leases Low. You may want to make modifications to one of the below scopes.\"\r\n            }\r\n            Write-Host \"[Alert] Scope: $Name Leases Used(In Use\/Free\/Total): $($Stats.InUse)\/$($Stats.Free)\/$($Stats.InUse+$Stats.Free)\"\r\n            $ShouldAlert = $true\r\n        }\r\n        else {\r\n            Write-Host \"[Info] Scope: $Name Leases Used(In Use\/Free\/Total): $($Stats.InUse)\/$($Stats.Free)\/$($Stats.InUse+$Stats.Free)\"\r\n        }\r\n    }\r\n\r\n    # IPv6\r\n    # Get all DHCP scopes\r\n    $v6Scopes = Get-DhcpServerv6Scope | Where-Object { $_.State }\r\n\r\n    # Iterate through each scope\r\n    foreach ($scope in $v6Scopes) {\r\n        # Get statistics for the scope\r\n        $Stats = Get-DhcpServerv6ScopeStatistics -Prefix $scope.Prefix\r\n\r\n        # Get the name of the scope\r\n        $Name = (Get-DhcpServerv6Scope -Prefix $scope.Prefix).Name\r\n\r\n        # Check if the scope should be excluded\r\n        if (-not [String]::IsNullOrWhiteSpace($ExcludeScope) -and $Name -in $ExcludeScope) {\r\n            continue\r\n        }\r\n\r\n        # Check if the scope should be included\r\n        if (-not [String]::IsNullOrWhiteSpace($IncludeScope) -and $Name -notin $IncludeScope) {\r\n            continue\r\n        }\r\n\r\n        # Check if the number of free leases is less than the threshold\r\n        if ($Stats.Free -lt $LeaseThreshold ) {\r\n            if ($ShouldAlert -eq $false) {\r\n                # Output once if this is the first scope to trigger an alert\r\n                Write-Host \"[Alert] Available DHCP Leases Low. You may want to make modifications to one of the below scopes.\"\r\n            }\r\n            Write-Host \"[Alert] Scope: $Name Leases Used(In Use\/Free\/Total): $($Stats.InUse)\/$($Stats.Free)\/$($Stats.InUse+$Stats.Free)\"\r\n            $ShouldAlert = $true\r\n        }\r\n        else {\r\n            Write-Host \"[Info] Scope: $Name Leases Used(In Use\/Free\/Total): $($Stats.InUse)\/$($Stats.Free)\/$($Stats.InUse+$Stats.Free)\"\r\n        }\r\n    }\r\n\r\n    exit 0\r\n\r\n}\r\nend {\r\n    \r\n    \r\n    \r\n}<\/pre>\n<p>&nbsp;<\/p>\n\n<h2>An\u00e1lisis detallado<\/h2>\n<p>Este script de PowerShell requiere el m\u00f3dulo DhcpServer y es compatible con Windows Server 2016 o versiones posteriores. Aqu\u00ed tienes una explicaci\u00f3n paso a paso de c\u00f3mo funciona:<\/p>\n<h2>Par\u00e1metros<\/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>LeaseThreshold<\/strong>: este par\u00e1metro establece el n\u00famero m\u00ednimo de concesiones libres necesarias antes de activar una alerta.<\/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=\"2\" data-aria-level=\"1\"><strong>ExcludeScope<\/strong>: especifica las concesiones DHCP que se excluir\u00e1n de la supervisi\u00f3n.<\/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=\"3\" data-aria-level=\"1\"><strong>IncludeScope<\/strong>: especifica las concesiones DHCP a incluir en la supervisi\u00f3n.<\/li>\n<\/ul>\n<h2>Configuraci\u00f3n inicial<\/h2>\n<p>El script comienza definiendo una funci\u00f3n para comprobar si se est\u00e1 ejecutando con privilegios de administrador, necesarios para acceder a los datos del servidor DHCP. A continuaci\u00f3n, procesa cualquier variable de entorno para los par\u00e1metros LeaseThreshold, ExcludeScope e IncludeScope, asegur\u00e1ndose de que est\u00e1n formateados correctamente.<\/p>\n<h2>\u00c1mbitos de exclusi\u00f3n e inclusi\u00f3n<\/h2>\n<p>El script divide y procesa los par\u00e1metros ExcludeScope e IncludeScope, convirti\u00e9ndolos en matrices. Garantiza que no haya solapamientos entre las dos listas, lo que podr\u00eda causar conflictos.<\/p>\n<h2>Comprobaci\u00f3n de concesiones DHCP<\/h2>\n<p>El script recupera todos los \u00e1mbitos DHCP disponibles (tanto IPv4 como IPv6). A continuaci\u00f3n, filtra estos \u00e1mbitos en funci\u00f3n de los par\u00e1metros ExcludeScope e IncludeScope. Para cada \u00e1mbito, el script obtiene las estad\u00edsticas, incluido el n\u00famero de concesiones utilizadas y libres.<\/p>\n<h2>Alertas<\/h2>\n<p>Si el n\u00famero de concesiones libres en cualquier \u00e1mbito cae por debajo del LeaseThreshold, el script emite un mensaje de alerta. Esto asegura que los administradores est\u00e9n inmediatamente al tanto de cualquier problema potencial con la disponibilidad de cesi\u00f3n DHCP.<\/p>\n<h2>Final<\/h2>\n<p>Si el script encuentra alg\u00fan error, como m\u00f3dulos que faltan o nombres de \u00e1mbito no v\u00e1lidos, muestra un mensaje de error apropiado y sale.<\/p>\n<h2>Posibles casos de uso<\/h2>\n<p>Imag\u00ednate a un profesional de TI que gestiona la red de una gran organizaci\u00f3n que dispone de varios servidores DHCP repartidos por diferentes ubicaciones. Cada servidor gestiona varios \u00e1mbitos, y es fundamental garantizar que siempre haya suficientes direcciones IP disponibles para los nuevos dispositivos. Mediante la aplicaci\u00f3n de este script, el profesional de TI puede:<\/p>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Aptos\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"1\" data-aria-level=\"1\"><strong>Supervisar proactivamente los \u00e1mbitos DHCP<\/strong>: comprueba regularmente el estado de las concesiones DHCP sin tener que revisar manualmente cada \u00e1mbito.<\/li>\n<li data-leveltext=\"%1.\" data-font=\"Aptos\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"1\" data-aria-level=\"1\"><strong>Recibir alertas<\/strong>: recibe notificaciones instant\u00e1neas si alg\u00fan \u00e1mbito cae por debajo de un umbral especificado de concesiones libres, lo que permite intervenir a tiempo.<\/li>\n<li data-leveltext=\"%1.\" data-font=\"Aptos\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"1\" data-aria-level=\"1\"><strong>Asignaci\u00f3n eficiente de recursos<\/strong>: ajusta la configuraci\u00f3n DHCP o a\u00f1ade m\u00e1s direcciones IP a los \u00e1mbitos seg\u00fan sea necesario, evitando interrupciones en la red.<\/li>\n<\/ol>\n<h2>Comparaciones<\/h2>\n<h3>Script vs. supervisi\u00f3n manual<\/h3>\n<p>Supervisar manualmente los \u00e1mbitos DHCP puede llevar mucho tiempo y ser propenso a errores humanos. El script automatiza este proceso, proporcionando una supervisi\u00f3n coherente y fiable. Adem\u00e1s, el script puede gestionar varios \u00e1mbitos y servidores simult\u00e1neamente, lo que ser\u00eda dif\u00edcil de gestionar manualmente.<\/p>\n<h3>Script vs. herramientas de terceros<\/h3>\n<p>Aunque las herramientas de terceros ofrecen soluciones completas de gesti\u00f3n DHCP, pueden ser caras y requerir infraestructura adicional. Este script PowerShell proporciona una soluci\u00f3n rentable y directa para las organizaciones que buscan mejorar su monitorizaci\u00f3n DHCP sin inversiones significativas.<\/p>\n<h2>FAQ<\/h2>\n<h3>P: \u00bfQu\u00e9 ocurre si el script no se ejecuta con privilegios de administrador?<\/h3>\n<p>R: El script mostrar\u00e1 un mensaje de error y saldr\u00e1. Se requieren privilegios de administrador para acceder a los datos del servidor DHCP.<\/p>\n<h3>P: \u00bfPuedo utilizar este script en versiones anteriores de Windows Server?<\/h3>\n<p>R: El script est\u00e1 dise\u00f1ado para Windows Server 2016 o versiones posteriores. Es posible que las versiones anteriores no admitan el m\u00f3dulo DhcpServer necesario.<\/p>\n<h3>P: \u00bfQu\u00e9 ocurre si el m\u00f3dulo del servidor DHCP no est\u00e1 instalado?<\/h3>\n<p>R: El script mostrar\u00e1 un mensaje de error indicando que el m\u00f3dulo DhcpServer no est\u00e1 instalado. Tendr\u00e1s que instalar la funci\u00f3n de servidor DHCP y el m\u00f3dulo DhcpServer para utilizar este script.<\/p>\n<h2>Implicaciones<\/h2>\n<p>Una supervisi\u00f3n eficaz del \u00e1mbito DHCP puede mejorar significativamente la fiabilidad y la seguridad de la red. Al asegurarse de que siempre hay suficientes direcciones IP disponibles, los administradores de red pueden evitar problemas de conectividad y garantizar el funcionamiento sin problemas de los dispositivos de red. Este script ayuda a identificar posibles problemas antes de que se agraven, lo que permite una gesti\u00f3n y resoluci\u00f3n de problemas proactivas.<\/p>\n<h2>Recomendaciones<\/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=\"4\" data-aria-level=\"1\"><strong>Ejecuci\u00f3n regular<\/strong>: programa el script para que se ejecute a intervalos regulares mediante el Programador de tareas o una herramienta similar para garantizar una supervisi\u00f3n continua.<\/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=\"5\" data-aria-level=\"1\"><strong>Ajuste del umbral<\/strong>: ajusta el par\u00e1metro LeaseThreshold en funci\u00f3n de las necesidades de tu red para evitar falsas alarmas o alertas perdidas.<\/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=\"6\" data-aria-level=\"1\"><strong>Gesti\u00f3n del alcance<\/strong>: revisa y actualiza peri\u00f3dicamente los par\u00e1metros ExcludeScope e IncludeScope para reflejar los cambios en tu red.<\/li>\n<\/ul>\n<h2>Reflexiones finales<\/h2>\n<p>Supervisar los \u00e1mbitos DHCP es una tarea cr\u00edtica para mantener la fiabilidad de la red. Este script PowerShell proporciona una forma potente y <a href=\"https:\/\/www.ninjaone.com\/es\/eficiencia\" target=\"_blank\" rel=\"noopener\">eficaz<\/a> de automatizar este proceso, garantizando que los administradores reciban r\u00e1pidamente alertas sobre posibles problemas. Para los profesionales de TI y los MSP, este script puede ser una herramienta inestimable en su kit de herramientas de gesti\u00f3n de redes.<\/p>\n<p>Adem\u00e1s, el uso de herramientas como NinjaOne puede mejorar a\u00fan m\u00e1s la supervisi\u00f3n y gesti\u00f3n de la red, proporcionando soluciones integrales para el mantenimiento de la infraestructura de TI.<\/p>\n<p>Al implementar este script y seguir las mejores pr\u00e1cticas, las organizaciones pueden garantizar que sus servidores DHCP est\u00e9n siempre listos para satisfacer las demandas de la red, evitando interrupciones y manteniendo un funcionamiento impecable.<\/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":[4263],"class_list":["post-387239","script_hub","type-script_hub","status-publish","hentry","script_hub_category-windows","use_cases-supervision"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/script_hub\/387239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/script_hub"}],"about":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/types\/script_hub"}],"author":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/comments?post=387239"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/media?parent=387239"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/operating_system?post=387239"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/use_cases?post=387239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}