{"id":353764,"date":"2024-08-30T09:46:57","date_gmt":"2024-08-30T09:46:57","guid":{"rendered":"https:\/\/www.ninjaone.com\/script-hub\/monitorizar-el-espacio-en-disco\/"},"modified":"2024-10-13T19:09:01","modified_gmt":"2024-10-13T19:09:01","slug":"monitorizar-el-espacio-en-disco","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/es\/script-hub\/monitorizar-el-espacio-en-disco\/","title":{"rendered":"Gu\u00eda completa para monitorizar el espacio en disco en v\u00f3lumenes compartidos de Hyper-V con PowerShell"},"content":{"rendered":"<p>La gesti\u00f3n eficaz del espacio en disco es un aspecto fundamental para mantener una infraestructura inform\u00e1tica eficiente y fiable. Una poderosa herramienta en el arsenal del profesional de TI es PowerShell, un marco de automatizaci\u00f3n de tareas de Microsoft. Hoy nos adentraremos en un script PowerShell dise\u00f1ado <strong>para monitorizar el espacio en disco, en vol\u00famenes compartidos en un entorno de cluster Hyper-V<\/strong>. Este script es especialmente valioso 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> que necesitan garantizar que sus sistemas funcionan sin problemas y evitar<a href=\"https:\/\/www.ninjaone.com\/it-hub\/it-service-management\/what-is-network-downtime\/\" target=\"_blank\" rel=\"noopener\"> tiempos de inactividad<\/a> debidos a problemas de almacenamiento.<\/p>\n<h2>Antecedentes<\/h2>\n<p>Monitorizar el espacio en disco es crucial para evitar cortes inesperados y garantizar que las aplicaciones y los servicios funcionen sin interrupciones. Los vol\u00famenes compartidos en un cl\u00faster Hyper-V pueden albergar numerosas m\u00e1quinas virtuales, y quedarse sin espacio puede tener graves consecuencias. Este script de PowerShell simplifica el proceso de monitorizar el espacio en disco, permitiendo a los administradores vigilar el espacio libre y tomar medidas antes de que surjan problemas.<\/p>\n<h2>El script para monitorizar el espacio libre en disco<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">Requires -Version 5.1\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    Hyper-V Monitor shared volume disk free space. Must be ran as a Local or Domain Admin user.\r\n.DESCRIPTION\r\n    Hyper-V Monitor shared volume disk free space. Must be ran as a Local or Domain Admin user.\r\n\r\n.EXAMPLE\r\n    (No Parameters)\r\n    ## EXAMPLE OUTPUT WITHOUT PARAMS ##\r\nName                       Path                  Size(GB) FreeSpace(GB) UsedSpace(GB) PercentFree\r\n----                       ----                  -------- ------------- ------------- -----------\r\nCluster Virtual Disk (vd1) C:\\ClusterStorage\\vd1 3,068.98 168.77        2900.21       9.99\r\n\r\nPARAMETER: -MinimumPercentage 20\r\n    Only errors when any shared volume disk is below the specified percentage.\r\n    Defaults to 10 percent.\r\n.EXAMPLE\r\n    -MinimumPercentage 20\r\n    ## EXAMPLE OUTPUT WITH MinimumPercentage ##\r\nName                       Path                  Size(GB) FreeSpace(GB) UsedSpace(GB) PercentFree\r\n----                       ----                  -------- ------------- ------------- -----------\r\nCluster Virtual Disk (vd1) C:\\ClusterStorage\\vd1 3,068.98 168.77        2900.21       9.99\r\n\r\nPARAMETER: -MinimumFreeBytes 1073741824\r\n    Only errors when any shared volume disk is below the specified percentage.\r\n    Defaults to 1GB or 1073741824 bytes.\r\n.EXAMPLE\r\n    -MinimumFreeBytes 1073741824\r\n    ## EXAMPLE OUTPUT WITH MinimumFreeBytes ##\r\nName                       Path                  Size(GB) FreeSpace(GB) UsedSpace(GB) PercentFree\r\n----                       ----                  -------- ------------- ------------- -----------\r\nCluster Virtual Disk (vd1) C:\\ClusterStorage\\vd1 3,068.98 168.77        2900.21       9.99\r\n\r\nPARAMETER: -ExcludeDrivesByName MyDisk\r\n    Excludes drives that contains the text MyDisk in its name.\r\n.EXAMPLE\r\n    -ExcludeDrivesByName 1073741824\r\n    ## EXAMPLE OUTPUT WITH ExcludeDrivesByName ##\r\nName                       Path                  Size(GB) FreeSpace(GB) UsedSpace(GB) PercentFree\r\n----                       ----                  -------- ------------- ------------- -----------\r\nCluster Virtual Disk (vd1) C:\\ClusterStorage\\vd1 3,068.98 168.77        2900.21       9.99\r\n\r\nPARAMETER: -ExcludeDrivesByPath C:\\ClusterStorage\\MyDisk\r\n    Excludes drives that contains the text MyDisk in its name.\r\n.EXAMPLE\r\n    -ExcludeDrivesByPath C:\\ClusterStorage\\MyDisk\r\n.EXAMPLE\r\n    -ExcludeDrivesByPath MyDisk\r\n    ## EXAMPLE OUTPUT WITH ExcludeDrivesByPath ##\r\nName                       Path                  Size(GB) FreeSpace(GB) UsedSpace(GB) PercentFree\r\n----                       ----                  -------- ------------- ------------- -----------\r\nCluster Virtual Disk (vd1) C:\\ClusterStorage\\vd1 3,068.98 168.77        2900.21       9.99\r\n\r\nPARAMETER: -CustomFieldParam \"ReplaceMeWithAnyMultilineCustomField\"\r\n    Saves the results to a multi-line string custom field.\r\n.EXAMPLE\r\n    -CustomFieldParam \"ReplaceMeWithAnyMultilineCustomField\"\r\n    ## EXAMPLE OUTPUT WITH CustomFieldParam ##\r\nName                       Path                  Size(GB) FreeSpace(GB) UsedSpace(GB) PercentFree\r\n----                       ----                  -------- ------------- ------------- -----------\r\nCluster Virtual Disk (vd1) C:\\ClusterStorage\\vd1 3,068.98 168.77        2900.21       9.99\r\n.OUTPUTS\r\n    None\r\n.NOTES\r\n    Minimum OS Architecture Supported: Windows Server 2016\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    [int]$MinimumPercentage = 10,\r\n    $MinimumFreeBytes = 1GB,\r\n    [String]$ExcludeDrivesByName,\r\n    [String]$ExcludeDrivesByPath,\r\n    [string]$CustomFieldParam\r\n)\r\n\r\nbegin {\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    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    function Get-FriendlySize {\r\n        param($Bytes)\r\n        # Converts Bytes to the highest matching unit\r\n        $Sizes = 'Bytes,KB,MB,GB,TB,PB,EB,ZB' -split ','\r\n        for ($i = 0; ($Bytes -ge 1kb) -and ($i -lt $Sizes.Count); $i++) { $Bytes \/= 1kb }\r\n        $N = 2\r\n        if ($i -eq 0) { $N = 0 }\r\n        if ($Bytes) { \"$([System.Math]::Round($Bytes,$N)) $($Sizes[$i])\" }else { \"0 B\" }\r\n    }\r\n    function Get-Size {\r\n        param (\r\n            [string]$String,\r\n            [ValidateSet(\"PB\", \"TB\", \"GB\", \"MB\", \"KB\", \"B\", \"Bytes\")][string]$DefaultSize = \"GB\"\r\n        )\r\n        switch -wildcard ($String) {\r\n            '*PB' { [int64]$($String -replace '[^\\d+]+') * 1PB; break }\r\n            '*TB' { [int64]$($String -replace '[^\\d+]+') * 1TB; break }\r\n            '*GB' { [int64]$($String -replace '[^\\d+]+') * 1GB; break }\r\n            '*MB' { [int64]$($String -replace '[^\\d+]+') * 1MB; break }\r\n            '*KB' { [int64]$($String -replace '[^\\d+]+') * 1KB; break }\r\n            '*B' { [int64]$($String -replace '[^\\d+]+') * 1; break }\r\n            '*Bytes' { [int64]$($String -replace '[^\\d+]+') * 1; break }\r\n            Default { Get-Size -String \"$String $DefaultSize\" }\r\n        }\r\n    }\r\n    function Invoke-FilterDisks {\r\n        [CmdletBinding()]\r\n        param(\r\n            [parameter(ValueFromPipeline = $true)]\r\n            $Disks\r\n        )\r\n        process {\r\n            $Disks | ForEach-Object {\r\n                # Check if exclude by name is needed\r\n                if ($([string]::IsNullOrEmpty($ExcludeDrivesByName) -or [string]::IsNullOrWhiteSpace($ExcludeDrivesByName))) {\r\n                    $_\r\n                }\r\n                else {\r\n                    if (\r\n                        $_.Name -like \"*$ExcludeDrivesByName*\"\r\n                    ) {\r\n                        # Output Nothing\r\n                    }\r\n                    else {\r\n                        $_\r\n                    }\r\n                }\r\n            } | ForEach-Object {\r\n                # Check if exclude by name is needed\r\n                if ($([string]::IsNullOrEmpty($ExcludeDrivesByPath) -or [string]::IsNullOrWhiteSpace($ExcludeDrivesByPath))) {\r\n                    $_\r\n                }\r\n                else {\r\n                    if (\r\n                        $_.Path -like \"*$ExcludeDrivesByPath*\"\r\n                    ) {\r\n                        # Output Nothing\r\n                    }\r\n                    else {\r\n                        $_\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n    if ($env:MinimumPercentage) {\r\n        $MinimumPercentage = $env:MinimumPercentage\r\n    }\r\n    if ($env:minimumFreeSpace) {\r\n        $MinimumFreeBytes = Get-Size -String $env:minimumFreeSpace\r\n    }\r\n    if ($env:ExcludeDrivesByName) {\r\n        $ExcludeDrivesByName = $env:ExcludeDrivesByName\r\n    }\r\n    if ($env:ExcludeDrivesByPath) {\r\n        $ExcludeDrivesByPath = $env:ExcludeDrivesByPath\r\n    }\r\n    if ($env:CustomFieldParam) {\r\n        $CustomFieldParam = $env:CustomFieldParam\r\n    }\r\n}\r\nprocess {\r\n    if (Test-IsSystem) {\r\n        Write-Error -Message \"Access Denied. Please run with a Domain Account or a Local Account that has permissions to access this node.\"\r\n        exit 1\r\n    }\r\n\r\n    if (-not (Test-IsElevated)) {\r\n        Write-Error -Message \"Access Denied. Please run with Administrator privileges.\"\r\n        exit 1\r\n    }\r\n\r\n    Import-Module FailoverClusters -ErrorAction SilentlyContinue\r\n\r\n    if (-not $(Get-Command -Name \"Get-Cluster\" -ErrorAction SilentlyContinue)) {\r\n        Write-Error \"[Error] Must run this script on a server that is apart of a Cluster or can communicate with a Cluster.\"\r\n        exit 1\r\n    }\r\n\r\n    try {\r\n        Get-ClusterNode -ErrorAction Stop | Out-Null\r\n    }\r\n    catch {\r\n        Write-Error \"[Error] Failed to get Cluster Nodes.\"\r\n        exit 1\r\n    }\r\n\r\n    # Get Cluster Shared Volume Info\r\n    $Volumes = foreach ( $csv in $(Get-ClusterSharedVolume) ) {\r\n        foreach ( $csvinfo in $($csv | Select-Object -Property Name -ExpandProperty SharedVolumeInfo) ) {\r\n            [PSCustomObject]@{\r\n                Name        = $csv.Name\r\n                Path        = $csvinfo.FriendlyVolumeName\r\n                Size        = $csvinfo.Partition.Size\r\n                FreeSpace   = $csvinfo.Partition.FreeSpace\r\n                UsedSpace   = $csvinfo.Partition.UsedSpace\r\n                PercentFree = $csvinfo.Partition.PercentFree\r\n            }\r\n        }\r\n    }\r\n\r\n    # Prep Format-Table substitutions\r\n    $Size = @{ Label = \"Size(GB)\" ; Expression = { (Get-FriendlySize -Bytes $_.Size) } }\r\n    $FreeSpace = @{ Label = \"FreeSpace(GB)\" ; Expression = { (Get-FriendlySize -Bytes $_.FreeSpace) } }\r\n    $UsedSpace = @{ Label = \"UsedSpace(GB)\" ; Expression = { (Get-FriendlySize -Bytes $_.UsedSpace) } }\r\n    $PercentFree = @{ Label = \"PercentFree\" ; Expression = { ($_.PercentFree) } }\r\n    # Sort disks by FreeSpace\r\n    $Disks = $Volumes | Sort-Object FreeSpace\r\n    # Save results as a string\r\n    $DisksFormattedString = $Disks | Format-Table -AutoSize Name, Path, $Size, $FreeSpace, $UsedSpace, $PercentFree | Out-String\r\n\r\n    # If using a custom field sent that to the specified custom field, should be a multi-line\r\n    if ($CustomFieldParam) {\r\n        Ninja-Property-Set -Name $CustomFieldParam -Value $DisksFormattedString\r\n    }\r\n\r\n    # Loop through each disk\r\n    $DiskUnderPercentage = $Disks | Invoke-FilterDisks | Where-Object { $_.PercentFree -lt $MinimumPercentage }\r\n    $DiskUnderFreeBytes = $Disks | Invoke-FilterDisks | Where-Object { $_.FreeSpace -lt $MinimumFreeBytes }\r\n\r\n    if ($DiskUnderPercentage -or $DiskUnderFreeBytes) {\r\n        if ($DiskUnderPercentage) {\r\n            Write-Host \"[Issue] One or more Disks under $MinimumPercentage % free!\"\r\n        }\r\n        if ($DiskUnderFreeBytes) {\r\n            Write-Host \"[Issue] One or more Disks under $(Get-FriendlySize -Bytes $MinimumFreeBytes) free!\"\r\n        }\r\n        $DisksFormattedString | Write-Host\r\n        exit 1\r\n    }\r\n\r\n    # List all shared volumes\r\n    if (-not $DiskUnderPercentage) {\r\n        Write-Host \"[Info] One or more Disks over $MinimumPercentage % free.\"\r\n    }\r\n    if (-not $DiskUnderFreeBytes) {\r\n        Write-Host \"[Info] One or more Disks over $(Get-FriendlySize -Bytes $MinimumFreeBytes) free.\"\r\n    }\r\n    $DisksFormattedString | Write-Host\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=\"blog-cta-new blog-cta-style-1\"><div class=\"cta-left\"><h2><\/h2><p><\/p><\/div><div class=\"cta-right\"><a class=\"button\" href=\"\"><\/a><\/div><\/div>\n<h2>An\u00e1lisis detallado<\/h2>\n<p>Vamos a desglosar el script paso a paso para entender su funcionalidad y c\u00f3mo puede utilizarse eficazmente para monitorizar el espacio en disco.<\/p>\n<p><strong>1. Requisitos previos y configuraci\u00f3n inicial.<\/strong> El script para monitorizar el espacio en disco requiere PowerShell versi\u00f3n 5.1 y debe ejecutarse con privilegios administrativos. Comienza definiendo varios par\u00e1metros como MinimumPercentage, MinimumFreeBytes, ExcludeDrivesByName, ExcludeDrivesByPath y CustomFieldParam.<\/p>\n<p><strong>2. Funciones de comprobaci\u00f3n de privilegios y c\u00e1lculo de tama\u00f1os<\/strong><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:1440,&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=\"2\">Test-IsElevated comprueba si el script se est\u00e1 ejecutando con privilegios de administrador.<\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:1440,&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=\"2\">Test-IsSystem asegura que el script no se est\u00e1 ejecutando como una cuenta del sistema.<\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:1440,&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=\"2\">Get-FriendlySize y Get-Size convierten los valores en bytes a unidades m\u00e1s legibles como KB, MB, GB, etc.<\/li>\n<\/ul>\n<p><strong>3. Filtrado y variables de entorno.<\/strong> El script para monitorizar el espacio en disco configura funciones para filtrar unidades en funci\u00f3n de nombres o rutas especificados. Tambi\u00e9n comprueba si existen variables de entorno que puedan anular los par\u00e1metros del script.<\/p>\n<p><strong>4. Recuperaci\u00f3n de informaci\u00f3n sobre cl\u00fasteres y vol\u00famenes.<\/strong> El script para monitorizar el espacio en disco importa el m\u00f3dulo FailoverClusters y verifica que se est\u00e1 ejecutando en un servidor que forma parte de un cluster. A continuaci\u00f3n, recupera informaci\u00f3n sobre los vol\u00famenes compartidos en el cl\u00faster, incluyendo su tama\u00f1o, espacio libre, espacio utilizado y porcentaje de espacio libre.<\/p>\n<p><strong>5. Formateo y salida.<\/strong> El script para monitorizar el espacio en disco formatea la informaci\u00f3n del disco para que sea legible y comprueba si alg\u00fan volumen est\u00e1 por debajo de los umbrales de espacio libre especificados. Si se detectan problemas, muestra los detalles y sale con un estado de error. En caso contrario, confirma que todos los vol\u00famenes tienen suficiente espacio libre.<\/p>\n<h2>Posibles casos de uso<\/h2>\n<p>Imagina un administrador de TI responsable de un cl\u00faster Hyper-V que aloja m\u00e1quinas virtuales cr\u00edticas. Este administrador puede utilizar el script para automatizar la monitorizaci\u00f3n del espacio en disco, asegur\u00e1ndose de que se le avisa antes de que cualquier volumen se quede cr\u00edticamente corto de espacio. Este enfoque proactivo les permite asignar almacenamiento adicional o limpiar archivos innecesarios, evitando posibles cortes y manteniendo el rendimiento del sistema.<\/p>\n<h2>Comparaciones<\/h2>\n<p>En comparaci\u00f3n con la supervisi\u00f3n manual o el uso de herramientas b\u00e1sicas integradas, este script para monitorizar el espacio en disco proporciona un enfoque m\u00e1s automatizado y detallado. No s\u00f3lo comprueba el espacio libre, sino que tambi\u00e9n permite la personalizaci\u00f3n basada en nombres de vol\u00famenes, rutas y requisitos espec\u00edficos de espacio libre. Otros m\u00e9todos, como las herramientas de supervisi\u00f3n de terceros, pueden ofrecer una funcionalidad similar, pero a menudo tienen un coste m\u00e1s elevado y requieren una configuraci\u00f3n adicional.<\/p>\n<h2>FAQ<\/h2>\n<h3>P: \u00bfEste script para monitorizar el espacio en disco puede ejecutarse en cualquier versi\u00f3n de Windows Server?<\/h3>\n<p>R: El script para monitorizar el espacio en disco es compatible con Windows Server 2016 y versiones posteriores debido a los requisitos del m\u00f3dulo FailoverClusters.<\/p>\n<h3>P: \u00bfQu\u00e9 permisos se necesitan para ejecutar este script?<\/h3>\n<p>R: El script para monitorizar el espacio en disco debe ejecutarse con privilegios de administrador local o de dominio para acceder a la informaci\u00f3n necesaria del cl\u00faster.<\/p>\n<h3>P: \u00bfC\u00f3mo puedo excluir determinados vol\u00famenes de la supervisi\u00f3n?<\/h3>\n<p>R: Puedes utilizar los par\u00e1metros ExcludeDrivesByName o ExcludeDrivesByPath para filtrar vol\u00famenes espec\u00edficos en funci\u00f3n de sus nombres o rutas.<\/p>\n<h2>Implicaciones<\/h2>\n<p>Los resultados de este script para monitorizar el espacio en disco pueden afectar significativamente a las operaciones de TI. Al identificar los vol\u00famenes con insuficiente espacio libre, los administradores pueden tomar medidas preventivas para evitar interrupciones del servicio. Esta supervisi\u00f3n proactiva tambi\u00e9n mejora la fiabilidad y el rendimiento general del sistema, contribuyendo a un entorno inform\u00e1tico m\u00e1s estable.<\/p>\n<h2>Recomendaciones<\/h2>\n<p>Cuando utilices este script para monitorizar el espacio en disco, ten en cuenta las siguientes pr\u00e1cticas recomendadas:<\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" 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\">Programa el script para que se ejecute a intervalos regulares mediante el Programador de tareas o herramientas similares.<\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" 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\">Personaliza los par\u00e1metros en funci\u00f3n de las necesidades espec\u00edficas de tu entorno.<\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" 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\">Aseg\u00farate de que dispones de permisos suficientes y de que ejecutas el script en los servidores adecuados.<\/li>\n<\/ul>\n<h2><strong>Reflexiones finales<\/strong><\/h2>\n<p>Los scripts de <a href=\"https:\/\/www.ninjaone.com\/it-hub\/endpoint-management\/what-is-powershell\/\" target=\"_blank\" rel=\"noopener\">PowerShell<\/a> como \u00e9ste para monitorizar el espacio en disco son herramientas inestimables para los profesionales de TI y los MSP, ya que ofrecen potentes funciones de automatizaci\u00f3n para gestionar y supervisar sistemas cr\u00edticos. Al incorporar estos scripts a sus flujos de trabajo, los administradores pueden mantener un mejor control sobre su infraestructura, garantizar un rendimiento \u00f3ptimo y prevenir posibles problemas antes de que se agraven.<\/p>\n<p><a href=\"https:\/\/www.ninjaone.com\/es\/\" target=\"_blank\" rel=\"noopener\">NinjaOne<\/a>, el software l\u00edder en operaciones de TI, puede mejorar a\u00fan m\u00e1s este proceso mediante la integraci\u00f3n de la ejecuci\u00f3n de scripts con sus capacidades de supervisi\u00f3n y gesti\u00f3n, proporcionando una soluci\u00f3n integral para la gesti\u00f3n de la infraestructura de TI.<\/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":"","_lmt_disable":""},"operating_system":[4212],"use_cases":[4259,4263],"class_list":["post-353764","script_hub","type-script_hub","status-publish","hentry","script_hub_category-windows"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/script_hub\/353764","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=353764"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/media?parent=353764"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/operating_system?post=353764"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/use_cases?post=353764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}