{"id":208594,"date":"2023-08-25T16:13:25","date_gmt":"2023-08-25T16:13:25","guid":{"rendered":"https:\/\/www.ninjaone.com\/script-hub\/como-monitorizar-comprobar-el-espacio-en-disco-con-script-powershell\/"},"modified":"2024-03-04T15:58:24","modified_gmt":"2024-03-04T15:58:24","slug":"como-monitorizar-comprobar-el-espacio-en-disco-con-script-powershell","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/es\/script-hub\/como-monitorizar-comprobar-el-espacio-en-disco-con-script-powershell\/","title":{"rendered":"C\u00f3mo comprobar y monitorizar de forma remota el espacio en disco con un script PowerShell"},"content":{"rendered":"<p>La <strong>monitorizaci\u00f3n del espacio en disco<\/strong> es un componente b\u00e1sico, pero al mismo tiempo fundamental, de todo soporte de TI proactivo, esencial para reducir el volumen de tickets y mantener la integridad y la estabilidad del sistema. La falta o el agotamiento del espacio en disco puede causar, obviamente, toda una serie de problemas y quejas por parte de los usuarios, desde fallos en las aplicaciones hasta bloqueos del sistema completo, por lo que crear alertas cuando las unidades caigan por debajo de cierto umbral es una forma excelente de evitarlos.<\/p>\n<p>Este post te ense\u00f1ar\u00e1 a comprobar la capacidad del disco y a notificar en caso de poco espacio, de forma remota, en toda tu base de usuarios.<\/p>\n<p>\u00bfC\u00f3mo puedes comprobar el espacio del disco duro de forma remota y enviar una alerta cuando quede poco espacio?<\/p>\n<ol>\n<li>Identifica qu\u00e9 unidades quieres supervisar y cu\u00e1les deseas excluir (si es el caso).<\/li>\n<li>Determina los umbrales de espacio en disco que deseas establecer para cada tipo de unidad.<\/li>\n<li>Personaliza en consonancia el script que encontrar\u00e1s a continuaci\u00f3n.<\/li>\n<\/ol>\n<p>Este script PowerShell ha sido dise\u00f1ado para alertar sobre las unidades que est\u00e1n por debajo de cierto porcentaje o tama\u00f1o especificado y hace una distinci\u00f3n entre unidades de sistema (las que se utilizan para arrancar el sistema operativo) y unidades de datos, proporcionando una visi\u00f3n global del uso del espacio en disco<\/p>\n<p>Es un script vers\u00e1til y personalizable y permite establecer par\u00e1metros para las unidades de sistema y de datos por separado. Puedes especificar el espacio libre m\u00ednimo tanto en porcentaje como en bytes e incluso excluir determinadas unidades de la comprobaci\u00f3n. Esta flexibilidad es ideal para cualquier <a href=\"https:\/\/www.ninjaone.com\/es\/blog\/10-buenas-practicas-para-el-servicio-de-asistencia\/\">profesional de TI<\/a> o <a href=\"https:\/\/www.ninjaone.com\/es\/que-es-un-msp\/\">MSP<\/a>.<\/p>\n<h2>El script Disk Space Monitor:<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-group=\"require-terms\">#Requires -Version 2.0\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    Alert on drive(s) that fall below a specified % or size. Distinguishes between System and Data drives.\r\n.DESCRIPTION\r\n    Alert on drive(s) that fall below a specified % or size. Distinguishes between System and Data drives.\r\n    The system drive is the drive(s) that are used to boot the OS.\r\n.EXAMPLE\r\n     -SystemDriveMinFreePercent 10 -SystemDriveMinFreeBytes 10GB -DataDriveMinFreePercent 20 -DataDriveMinFreeBytes 20GB\r\n    This checks all Drives\r\n.EXAMPLE\r\n     -ExcludeDrivesCustomField \"C,Z\" -SystemDriveMinFreePercentCustomField \"SystemDriveMinFreePercent\" -SystemDriveMinFreeBytes \"SystemDriveMinFreeBytes\" -DataDriveMinFreePercent \"DataDriveMinFreePercent\" -DataDriveMinFreeBytes \"DataDriveMinFreeBytes\"\r\n    This checks all Drives, except for C: and Z:.\r\n    Use this if you wish to to custom fields to specify the values from roles or globally.\r\n    This will pull the values from custom fields that would have otherwise been used from parameters.\r\n.EXAMPLE\r\n     -ExcludeDrivesByNameCustomField \"NoMonitor\" -SystemDriveMinFreePercentCustomField \"SystemDriveMinFreePercent\" -SystemDriveMinFreeBytes \"SystemDriveMinFreeBytes\" -DataDriveMinFreePercent \"DataDriveMinFreePercent\" -DataDriveMinFreeBytes \"DataDriveMinFreeBytes\"\r\n    This checks all Drives, except where a drive name\/label contains the text \"NoMonitor\".\r\n    Use this if you wish to to custom fields to specify the values from roles or globally.\r\n    This will pull the values from custom fields that would have otherwise been used from parameters.\r\n.EXAMPLE\r\n     No Parameters Specified\r\n    This checks all Drives with the defaults:\r\n        SystemDriveMinFreePercent   10%\r\n        SystemDriveMinFreeBytes     10GB\r\n        DataDriveMinFreePercent 20%\r\n        DataDriveMinFreeBytes   20GB\r\n.OUTPUTS\r\n    None\r\n.NOTES\r\n    Minimum OS Architecture Supported: Windows 7, Windows Server 2012 R2\r\n    Release Notes:\r\n    Initial Release\r\n    (c) 2023 NinjaOne\r\n    By using this script, you indicate your acceptance of the following legal terms as well as our Terms of Use at https:\/\/www.ninjaone.com\/terms-of-use.\r\n    Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms. \r\n    Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party. \r\n    Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library or website belonging to or under the control of any other software provider. \r\n    Warranty Disclaimer: The script is provided \u201cas is\u201d and \u201cas available\u201d, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations. \r\n    Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks. \r\n    Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script. \r\n    EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).\r\n#&gt;\r\n\r\n[CmdletBinding()]\r\nparam (\r\n    [Parameter()]\r\n    [String]\r\n    $ExcludeDrives,\r\n    $ExcludeDrivesCustomField, # If set, get value from a custom field with this name.\r\n    [String]\r\n    $ExcludeDrivesByName,\r\n    $ExcludeDrivesByNameCustomField, # If set, get value from a custom field with this name.\r\n    $SystemDriveMinFreePercent = 10,\r\n    $SystemDriveMinFreePercentCustomField, # If set, get value from a custom field with this name.\r\n    $SystemDriveMinFreeBytes = 10GB,\r\n    $SystemDriveMinFreeBytesCustomField, # If set, get value from a custom field with this name.\r\n    $DataDriveMinFreePercent = 20,\r\n    $DataDriveMinFreePercentCustomField, # If set, get value from a custom field with this name.\r\n    $DataDriveMinFreeBytes = 20GB,\r\n    $DataDriveMinFreeBytesCustomField # If set, get value from a custom field with this name.\r\n)\r\n\r\nbegin {\r\n    function Get-Size {\r\n        param (\r\n            [string]$String\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 { [int64]$($String -replace '[^d+]+') * 1 }\r\n        }\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 Invoke-DiskAlert {\r\n        param (\r\n            [PSObject[]]$Drives\r\n        )\r\n        $Drives | ForEach-Object {\r\n            $Type = if ($_.IsSystemDrive) { \"SystemDrive\" }else { \"DataDrive\" }\r\n            $Drive = $_\r\n            if ($Drive.totalSpace -and $Drive.freeSpace \/ $Drive.totalSpace * 100 -lt $Settings.\"$Type\".MinFreePercent) {\r\n                Write-Output \"$Type ($($Drive.driveName)) free space is under $($Settings.\"$Type\".MinFreePercent)% at $(Get-FriendlySize -Bytes $Drive.freeSpace)\"\r\n            }\r\n            elseif ($Drive.freeSpace -lt $Settings.$Type.MinFreeBytes) {\r\n                Write-Output \"$Type ($($Drive.driveName)) free space is under $(Get-FriendlySize -Bytes $Settings.\"$Type\".MinFreeBytes) at $(Get-FriendlySize -Bytes $Drive.freeSpace)\"\r\n            }\r\n        }\r\n    }\r\n    function Get-Drive {\r\n        param([string]$DriveName)\r\n        if ($(Get-Command -Name \"Get-CimInstance\")) {\r\n            Get-CimInstance -Query \"select * from Win32_DiskDrive\" | Where-Object { $_.Size } | ForEach-Object {\r\n                $d = $_\r\n                $d | ForEach-Object {\r\n                    $Disk = $_\r\n                    $p = Get-CimInstance -Query \"ASSOCIATORS OF {Win32_DiskDrive.DeviceID='$($Disk.DeviceID)'}  WHERE AssocClass = Win32_DiskDriveToDiskPartition\"\r\n                    $p | ForEach-Object {\r\n                        $Partition = $_\r\n                        Get-CimInstance -Query \"ASSOCIATORS OF {Win32_DiskPartition.DeviceID='$($Partition.DeviceID)'} WHERE AssocClass = Win32_LogicalDiskToPartition\" | ForEach-Object {\r\n                            $ld = $_\r\n                            [PSCustomObject]@{\r\n                                driveName     = $ld.DeviceId # C:\r\n                                IsSystemDrive = if ($p | Where-Object { $_.BootPartition }) { $true }else { $false }\r\n                                freeSpace     = $ld.FreeSpace # in bytes\r\n                                totalSpace    = $ld.Size # in bytes\r\n                                fileSystem    = $ld.FileSystem # NTFS\r\n                                physicalName  = $d.Name # \\.PHYSICALDRIVE2\r\n                                diskName      = $d.Caption # WDC WD5001AALS-xxxxxx\r\n                                diskModel     = $d.Model # WDC WD5001AALS-xxxxxx\r\n                                diskInterface = $d.InterfaceType # IDE\r\n                                mediaStatus   = $d.Status # OK\r\n                                volumeName    = $ld.VolumeName # System\r\n                                volumeSerial  = $ld.VolumeSerialNumber # 12345678\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n        else {\r\n            Get-WmiObject -Query \"select * from Win32_DiskDrive\" | Where-Object { $_.Size } | ForEach-Object {\r\n                $d = $_\r\n                $d | ForEach-Object {\r\n                    $Disk = $_\r\n                    $p = Get-WmiObject -Query \"ASSOCIATORS OF {Win32_DiskDrive.DeviceID='$($Disk.DeviceID)'}  WHERE AssocClass = Win32_DiskDriveToDiskPartition\"\r\n                    $p | ForEach-Object {\r\n                        $Partition = $_\r\n                        Get-WmiObject -Query \"ASSOCIATORS OF {Win32_DiskPartition.DeviceID='$($Partition.DeviceID)'} WHERE AssocClass = Win32_LogicalDiskToPartition\" | ForEach-Object {\r\n                            $ld = $_\r\n                            [PSCustomObject]@{\r\n                                driveName     = $ld.DeviceId # C:\r\n                                IsSystemDrive = if ($p | Where-Object { $_.BootPartition }) { $true }else { $false }\r\n                                freeSpace     = $ld.FreeSpace # in bytes\r\n                                totalSpace    = $ld.Size # in bytes\r\n                                fileSystem    = $ld.FileSystem # NTFS\r\n                                physicalName  = $d.Name # \\.PHYSICALDRIVE2\r\n                                diskName      = $d.Caption # WDC WD5001AALS-xxxxxx\r\n                                diskModel     = $d.Model # WDC WD5001AALS-xxxxxx\r\n                                diskInterface = $d.InterfaceType # IDE\r\n                                mediaStatus   = $d.Status # OK\r\n                                volumeName    = $ld.VolumeName # System\r\n                                volumeSerial  = $ld.VolumeSerialNumber # 12345678\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\nprocess {\r\n    # Get values from parameters\r\n    $Settings = [PSCustomObject]@{\r\n        SystemDrive = [PSCustomObject]@{\r\n            MinFreePercent = if ($env:SystemDriveMinFreePercent) { $env:SystemDriveMinFreePercent -replace '%' }else { $SystemDriveMinFreePercent }\r\n            MinFreeBytes   = if ($env:SystemDriveMinFreeBytes) { Get-Size -Size $env:SystemDriveMinFreeBytes }else { $SystemDriveMinFreeBytes }\r\n        }\r\n        DataDrive   = [PSCustomObject]@{\r\n            MinFreePercent = if ($env:DataDriveMinFreePercent) { $env:DataDriveMinFreePercent -replace '%' }else { $DataDriveMinFreePercent }\r\n            MinFreeBytes   = if ($env:DataDriveMinFreeBytes) { Get-Size -Size $env:DataDriveMinFreeBytes }else { $DataDriveMinFreeBytes }\r\n        }\r\n    }\r\n    # Get values from custom field\r\n    if ($SystemDriveMinFreePercentCustomField) {\r\n        $Settings.SystemDrive.MinFreePercent = Ninja-Property-Get -Name $SystemDriveMinFreePercentCustomField\r\n    }\r\n    if ($SystemDriveMinFreeBytesCustomField) {\r\n        $Settings.SystemDrive.MinFreeBytes = Ninja-Property-Get -Name $SystemDriveMinFreeBytesCustomField\r\n    }\r\n    if ($DataDriveMinFreePercentCustomField) {\r\n        $Settings.DataDrive.MinFreePercent = Ninja-Property-Get -Name $DataDriveMinFreePercentCustomField\r\n    }\r\n    if ($DataDriveMinFreeBytesCustomField) {\r\n        $Settings.DataDrive.MinFreeBytes = Ninja-Property-Get -Name $DataDriveMinFreeBytesCustomField\r\n    }\r\n    if ($env:ExcludeDrives) {\r\n        $ExcludeDrives = $env:ExcludeDrives\r\n    }\r\n    if ($ExcludeDrivesCustomField) {\r\n        $ExcludeDrives = Ninja-Property-Get -Name $ExcludeDrivesCustomField\r\n    }\r\n    if ($env:ExcludeDrivesByName) {\r\n        $ExcludeDrivesByName = $env:ExcludeDrivesByName\r\n    }\r\n    if ($env:ExcludeDrivesByNameCustomField) {\r\n        $ExcludeDrivesByNameCustomField = $env:ExcludeDrivesByNameCustomField\r\n    }\r\n\r\n    # System.IO.DriveInfo is usable as far back as .NET 2.0 for Windows 7 compatibility.\r\n    # Reference: https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.io.driveinfo?view=netstandard-2.0\r\n\r\n    # Get drives that are in the ready state\r\n    $Drives = Get-Drive\r\n\r\n    $Results = if ($Drives) {\r\n        $DrivesFiltered = if ($ExcludeDrivesByName) {\r\n            $Drives | Where-Object { $_.volumeName -notlike \"*$ExcludeDrivesByName*\" }\r\n        }\r\n        else { $Drive }\r\n\r\n        if ($ExcludeDrives) {\r\n            $DriveAlerts = Invoke-DiskAlert -Drives $DrivesFiltered\r\n            $DriveList = if ($ExcludeDrives -like \"*,*\") {\r\n                $ExcludeDrives -split ',' | Sort-Object -Unique\r\n            }\r\n            else {\r\n                $ExcludeDrives -split '' | Sort-Object -Unique | Select-Object -Skip 1\r\n            }\r\n            $DriveList | ForEach-Object {\r\n                $Drive = $_\r\n                $DriveAlerts | Where-Object { $_ -notlike \"*$($Drive):*\" }\r\n            }\r\n            \r\n        }\r\n        else {\r\n            Invoke-DiskAlert -Drives $Drives $DrivesFiltered\r\n        }\r\n    }\r\n    else {\r\n        # Should never get here, how was the script executed?!\r\n        \"No drives found?!\" | Out-String | Write-Host\r\n        exit 2\r\n    }\r\n\r\n    if ($Results) {\r\n        $Results | Out-String | Write-Host\r\n        exit 1\r\n    }\r\n    else {\r\n        Write-Host \"No drives found with low free space.\"\r\n        exit 0\r\n    }\r\n}\r\nend {\r\n    $ScriptVariables = @(\r\n        [PSCustomObject]@{\r\n            name           = \"Exclude Drives\"\r\n            calculatedName = \"excludedrives\"\r\n            required       = $false\r\n            defaultValue   = $null\r\n            valueType      = \"TEXT\"\r\n            valueList      = $null\r\n            description    = \"List if mounted drives to exclude from low drive check. Example: CFZ or C,F,Z\"\r\n        }\r\n        [PSCustomObject]@{\r\n            name           = \"Exclude Drives Custom Field\"\r\n            calculatedName = \"excludedrivescustomfield\"\r\n            required       = $false\r\n            defaultValue   = $null\r\n            valueType      = \"TEXT\"\r\n            valueList      = $null\r\n            description    = \"A custom field to get the value from. List if mounted drives to exclude from low drive check. Example: CFZ or C,F,Z\"\r\n        }\r\n        [PSCustomObject]@{\r\n            name           = \"Exclude Drives By Name\"\r\n            calculatedName = \"excludedrivesbyname\"\r\n            required       = $false\r\n            defaultValue   = $null\r\n            valueType      = \"TEXT\"\r\n            valueList      = $null\r\n            description    = \"Exclude drives with with the specified text in it's name\/label.\"\r\n        }\r\n        [PSCustomObject]@{\r\n            name           = \"Exclude Drives By Name Custom Field\"\r\n            calculatedName = \"excludedrivesbynamecustomfield\"\r\n            required       = $false\r\n            defaultValue   = $null\r\n            valueType      = \"TEXT\"\r\n            valueList      = $null\r\n            description    = \"A custom field to get the value from. Exclude drives with with the specified text in it's name\/label.\"\r\n        }\r\n        [PSCustomObject]@{\r\n            name           = \"System Drive Minimum Size in Percent\"\r\n            calculatedName = \"systemdriveminfreepercent\"\r\n            required       = $false\r\n            defaultValue   = [PSCustomObject]@{\r\n                type  = \"TEXT\"\r\n                value = \"10%\"\r\n            }\r\n            valueType      = \"TEXT\"\r\n            valueList      = $null\r\n            description    = \"The percentage of free space to alert on when the OS drive is below this percentage. Example: 50 or 50%\"\r\n        }\r\n        [PSCustomObject]@{\r\n            name           = \"System Drive Minimum Size in Bytes\"\r\n            calculatedName = \"systemdriveminfreebytes\"\r\n            required       = $false\r\n            defaultValue   = [PSCustomObject]@{\r\n                type  = \"TEXT\"\r\n                value = \"10GB\"\r\n            }\r\n            valueType      = \"TEXT\"\r\n            valueList      = $null\r\n            description    = \"The minimum free space to alert on when the OS drive is below this amount. Example: 50GB, 50000MB, or 53687091200\"\r\n        }\r\n        [PSCustomObject]@{\r\n            name           = \"Data Drive Minimum Size in Percent\"\r\n            calculatedName = \"datadriveminfreepercent\"\r\n            required       = $false\r\n            defaultValue   = [PSCustomObject]@{\r\n                type  = \"TEXT\"\r\n                value = \"20%\"\r\n            }\r\n            valueType      = \"TEXT\"\r\n            valueList      = $null\r\n            description    = \"The percentage of free space to alert on when a Data drive is below this percentage. Example: 50 or 50%\"\r\n        }\r\n        [PSCustomObject]@{\r\n            name           = \"Data Drive Minimum Size in Bytes\"\r\n            calculatedName = \"datadriveminfreebytes\"\r\n            required       = $false\r\n            defaultValue   = [PSCustomObject]@{\r\n                type  = \"TEXT\"\r\n                value = \"20GB\"\r\n            }\r\n            valueType      = \"TEXT\"\r\n            valueList      = $null\r\n            description    = \"The minimum free space to alert on when the Data drive is below this amount. Example: 50GB, 50000MB, or 53687091200\"\r\n        }\r\n        [PSCustomObject]@{\r\n            name           = \"System Drive Minimum Size in Percent Custom Field\"\r\n            calculatedName = \"systemdriveminfreepercentcustomfield\"\r\n            required       = $false\r\n            defaultValue   = $null\r\n            valueType      = \"TEXT\"\r\n            valueList      = $null\r\n            description    = \"A custom field to get the value from. The percentage of free space to alert on when the OS drive is below this percentage. Example: 50 or 50%\"\r\n        }\r\n        [PSCustomObject]@{\r\n            name           = \"System Drive Minimum Size in Bytes Custom Field\"\r\n            calculatedName = \"systemdriveminfreebytescustomfield\"\r\n            required       = $false\r\n            defaultValue   = $null\r\n            valueType      = \"TEXT\"\r\n            valueList      = $null\r\n            description    = \"A custom field to get the value from. The minimum free space to alert on when the OS drive is below this amount. Example: 50GB, 50000MB, or 53687091200\"\r\n        }\r\n        [PSCustomObject]@{\r\n            name           = \"Data Drive Minimum Size in Percent Custom Field\"\r\n            calculatedName = \"datadriveminfreepercentscustomfield\"\r\n            required       = $false\r\n            defaultValue   = $null\r\n            valueType      = \"TEXT\"\r\n            valueList      = $null\r\n            description    = \"A custom field to get the value from. The percentage of free space to alert on when a Data drive is below this percentage. Example: 50 or 50%\"\r\n        }\r\n        [PSCustomObject]@{\r\n            name           = \"Data Drive Minimum Size in Bytes Custom Field\"\r\n            calculatedName = \"datadriveminfreebytescustomfield\"\r\n            required       = $false\r\n            defaultValue   = $null\r\n            valueType      = \"TEXT\"\r\n            valueList      = $null\r\n            description    = \"A custom field to get the value from. The minimum free space to alert on when the Data drive is below this amount. Example: 50GB, 50000MB, or 53687091200\"\r\n        }\r\n    )\r\n    $ScriptName = \"Condition Low Disk Space Alert\"\r\n}<\/pre>\n\n<div class=\"in-context-cta\"><p>Accede a m\u00e1s de 700 scripts en el Dojo de NinjaOne <a href=\"https:\/\/app.ninjarmm.com\/auth\/?return_to=https%3A%2F%2Fninjarmm.zendesk.com%2Fhc%2Fen-us%2Fsections%2F360012866471-Script-Share#\/register\" target=\"_blank\" rel=\"noopener\">aqu\u00ed<\/a><\/p>\n<\/div>\n<h2>C\u00f3mo funciona el script Disk Space Monitor<\/h2>\n<p>El script funciona recopilando primero informaci\u00f3n sobre todas las unidades del sistema. Entonces, filtra las unidades que hayas decidido excluir y comprueba las restantes seg\u00fan los par\u00e1metros establecidos. Si alguna unidad queda por debajo del espacio libre m\u00ednimo especificado, el script te avisar\u00e1, permiti\u00e9ndote tomar medidas antes de que se convierta en un problema.<\/p>\n<p>Una de las caracter\u00edsticas m\u00e1s destacadas de este script es su capacidad para extraer valores de campos personalizados. Esto significa que puedes especificar valores globalmente o a partir de roles, a\u00f1adiendo otra capa de personalizaci\u00f3n al script.<\/p>\n<h2>Transforma tu gesti\u00f3n de TI con NinjaOne<\/h2>\n<p>Si bien es posible monitorear el espacio en disco utilizando \u00fanicamente PowerShell desde un equipo local, hay una manera a\u00fan mejor de gestionar los recursos de TI de forma remota y a escala: NinjaOne.<\/p>\n<p>NinjaOne es una <a href=\"https:\/\/www.ninjaone.com\/es\/unified-it-operations\/\">plataforma de gesti\u00f3n unificada de TI<\/a> que incorpora pasos de correcci\u00f3n, utilizando sripts si es necesario, en las pol\u00edticas del dispositivo altamente flexibles, que determinan cu\u00e1ndo se alcanzan los umbrales de alerta y los pasos que deben tomarse a continuaci\u00f3n. NinjaOne proporciona acceso a cientos de scripts que pueden resultar \u00fatiles, y la posibilidad de crear scripts propios en casi cualquier lenguaje de scripting.<\/p>\n<p>NinjaOne puede ayudarte a <a href=\"https:\/\/www.ninjaone.com\/es\/supervision-gestion-de-endpoints\/\">supervisar y gestionar todos tus endpoints de TI<\/a> a gran escala desde un \u00fanico panel de control. Gracias a las pol\u00edticas y los scripts, puedes automatizar pr\u00e1cticamente cualquier tarea rutinaria, desde la instalaci\u00f3n de parches de software hasta la generaci\u00f3n de informes, ahorrando tiempo y gestionando proactivamente las incidencias antes de que se conviertan en problemas.<\/p>\n","protected":false},"author":35,"featured_media":206569,"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":[4265],"class_list":["post-208594","script_hub","type-script_hub","status-publish","has-post-thumbnail","hentry","script_hub_category-windows"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/script_hub\/208594","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=208594"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/media\/206569"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/media?parent=208594"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/operating_system?post=208594"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/use_cases?post=208594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}