{"id":387175,"date":"2024-12-02T14:27:33","date_gmt":"2024-12-02T14:27:33","guid":{"rendered":"https:\/\/www.ninjaone.com\/?post_type=script_hub&#038;p=387175"},"modified":"2024-12-02T14:28:37","modified_gmt":"2024-12-02T14:28:37","slug":"obtener-la-ultima-hora-del-bios","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/es\/script-hub\/obtener-la-ultima-hora-del-bios\/","title":{"rendered":"Supervisar la \u00faltima hora del BIOS con PowerShell para optimizar el rendimiento del sistema"},"content":{"rendered":"<p>En este art\u00edculo, vamos a ver c\u00f3mo <strong>obtener la \u00faltima hora del BIOS<\/strong>. En&nbsp;en el cambiante entorno de TI actual, es primordial garantizar que los sistemas funcionen con eficacia. Un aspecto cr\u00edtico de esta eficiencia es el tiempo de arranque del sistema, a menudo denominado \u00ab\u00daltima hora del BIOS\u00bb.<\/p>\n<p>La supervisi\u00f3n y gesti\u00f3n de este tiempo puede ayudar a los profesionales de TI a optimizar el rendimiento del sistema y solucionar problemas de forma m\u00e1s eficaz. Este post profundiza en un <a href=\"https:\/\/www.ninjaone.com\/it-hub\/endpoint-management\/what-is-powershell\/\" target=\"_blank\" rel=\"noopener\">script de PowerShell<\/a> dise\u00f1ado para obtener la \u00daltima hora del BIOS de la secci\u00f3n de inicio del administrador de tareas, alertando a los usuarios si supera un umbral especificado.<\/p>\n<h2>Contexto<\/h2>\n<p>La \u00daltima hora del BIOS es una m\u00e9trica disponible en la secci\u00f3n de inicio del Administrador de tareas de Windows que indica el tiempo que tarda el BIOS del sistema en inicializarse durante el proceso de arranque. Un tiempo de BIOS m\u00e1s largo puede significar problemas potenciales como problemas de hardware o configuraciones err\u00f3neas. 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>, hacer un seguimiento de esta m\u00e9trica puede ser crucial para mantener el buen estado del sistema y garantizar tiempos de arranque r\u00e1pidos.<\/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    Gets the Last BIOS time from the startup section of task manager and alerts if it exceeds a threshold you specify.\r\n.DESCRIPTION\r\n    Gets the Last BIOS time from the startup section of task manager and alerts if it exceeds a threshold you specify.\r\n    Can save the result to a custom field.\r\n\r\n.EXAMPLE\r\n    (No Parameters)\r\n    ## EXAMPLE OUTPUT WITHOUT PARAMS ##\r\n    Last BIOS Time: 14.6s\r\n\r\nPARAMETER: -BootCustomField \"BootTime\"\r\n    Saves the boot time to this Text Custom Field.\r\n.EXAMPLE\r\n    -BootCustomField \"BootTime\"\r\n    ## EXAMPLE OUTPUT WITH BootCustomField ##\r\n    Last BIOS Time: 14.6s\r\n\r\nPARAMETER: -Seconds 20\r\n    Sets the threshold for when the boot time is greater than this number.\r\n    In this case the boot time is over the threshold.\r\n.EXAMPLE\r\n    -Seconds 20\r\n    ## EXAMPLE OUTPUT WITH Seconds ##\r\n    Last BIOS Time: 14.6s\r\n    [Error] Boot time exceeded threshold of 20s by 5.41s. Boot time: 14.6s\r\n\r\nPARAMETER: -Seconds 10\r\n    Sets the threshold for when the boot time is greater than this number.\r\n    In this case the boot time is under the threshold.\r\n.EXAMPLE\r\n    -Seconds 10\r\n    ## EXAMPLE OUTPUT WITH Seconds ##\r\n    Last BIOS Time: 14.6s\r\n    [Info] Boot time under threshold of 10s by 4.59s. Boot time: 14.6s\r\n\r\n.OUTPUTS\r\n    String\r\n.NOTES\r\n    Minimum OS Architecture Supported: Windows 10, 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    $Seconds,\r\n    [String]$BootCustomField\r\n)\r\n\r\nbegin {\r\n    if ($env:bootCustomField -and $env:bootCustomField -notlike \"null\") {\r\n        $BootCustomField = $env:bootCustomField\r\n    }\r\n    if ($env:bootTimeThreshold -and $env:bootTimeThreshold -notlike \"null\") {\r\n        # Remove any non digits\r\n        [double]$Seconds = $env:bootTimeThreshold -replace '[^0-9.]+'\r\n    }\r\n    function Set-NinjaProperty {\r\n        [CmdletBinding()]\r\n        Param(\r\n            [Parameter(Mandatory = $True)]\r\n            [String]$Name,\r\n            [Parameter()]\r\n            [String]$Type,\r\n            [Parameter(Mandatory = $True, ValueFromPipeline = $True)]\r\n            $Value,\r\n            [Parameter()]\r\n            [String]$DocumentName\r\n        )\r\n    \r\n        $Characters = $Value | Measure-Object -Character | Select-Object -ExpandProperty Characters\r\n        if ($Characters -ge 10000) {\r\n            throw [System.ArgumentOutOfRangeException]::New(\"Character limit exceeded, value is greater than 10,000 characters.\")\r\n        }\r\n        \r\n        # If we're requested to set the field value for a Ninja document we'll specify it here.\r\n        $DocumentationParams = @{}\r\n        if ($DocumentName) { $DocumentationParams[\"DocumentName\"] = $DocumentName }\r\n        \r\n        # This is a list of valid fields that can be set. If no type is given, it will be assumed that the input doesn't need to be changed.\r\n        $ValidFields = \"Attachment\", \"Checkbox\", \"Date\", \"Date or Date Time\", \"Decimal\", \"Dropdown\", \"Email\", \"Integer\", \"IP Address\", \"MultiLine\", \"MultiSelect\", \"Phone\", \"Secure\", \"Text\", \"Time\", \"URL\", \"WYSIWYG\"\r\n        if ($Type -and $ValidFields -notcontains $Type) { Write-Warning \"$Type is an invalid type! Please check here for valid types. https:\/\/ninjarmm.zendesk.com\/hc\/en-us\/articles\/16973443979789-Command-Line-Interface-CLI-Supported-Fields-and-Functionality\" }\r\n        \r\n        # The field below requires additional information to be set\r\n        $NeedsOptions = \"Dropdown\"\r\n        if ($DocumentName) {\r\n            if ($NeedsOptions -contains $Type) {\r\n                # We'll redirect the error output to the success stream to make it easier to error out if nothing was found or something else went wrong.\r\n                $NinjaPropertyOptions = Ninja-Property-Docs-Options -AttributeName $Name @DocumentationParams 2&gt;&amp;1\r\n            }\r\n        }\r\n        else {\r\n            if ($NeedsOptions -contains $Type) {\r\n                $NinjaPropertyOptions = Ninja-Property-Options -Name $Name 2&gt;&amp;1\r\n            }\r\n        }\r\n        \r\n        # If an error is received it will have an exception property, the function will exit with that error information.\r\n        if ($NinjaPropertyOptions.Exception) { throw $NinjaPropertyOptions }\r\n        \r\n        # The below type's require values not typically given in order to be set. The below code will convert whatever we're given into a format ninjarmm-cli supports.\r\n        switch ($Type) {\r\n            \"Checkbox\" {\r\n                # While it's highly likely we were given a value like \"True\" or a boolean datatype it's better to be safe than sorry.\r\n                $NinjaValue = [System.Convert]::ToBoolean($Value)\r\n            }\r\n            \"Date or Date Time\" {\r\n                # Ninjarmm-cli expects the GUID of the option to be selected. Therefore, the given value will be matched with a GUID.\r\n                $Date = (Get-Date $Value).ToUniversalTime()\r\n                $TimeSpan = New-TimeSpan (Get-Date \"1970-01-01 00:00:00\") $Date\r\n                $NinjaValue = $TimeSpan.TotalSeconds\r\n            }\r\n            \"Dropdown\" {\r\n                # Ninjarmm-cli is expecting the guid of the option we're trying to select. So we'll match up the value we were given with a guid.\r\n                $Options = $NinjaPropertyOptions -replace '=', ',' | ConvertFrom-Csv -Header \"GUID\", \"Name\"\r\n                $Selection = $Options | Where-Object { $_.Name -eq $Value } | Select-Object -ExpandProperty GUID\r\n        \r\n                if (-not $Selection) {\r\n                    throw [System.ArgumentOutOfRangeException]::New(\"Value is not present in dropdown\")\r\n                }\r\n        \r\n                $NinjaValue = $Selection\r\n            }\r\n            default {\r\n                # All the other types shouldn't require additional work on the input.\r\n                $NinjaValue = $Value\r\n            }\r\n        }\r\n        \r\n        # We'll need to set the field differently depending on if its a field in a Ninja Document or not.\r\n        if ($DocumentName) {\r\n            $CustomField = Ninja-Property-Docs-Set -AttributeName $Name -AttributeValue $NinjaValue @DocumentationParams 2&gt;&amp;1\r\n        }\r\n        else {\r\n            $CustomField = Ninja-Property-Set -Name $Name -Value $NinjaValue 2&gt;&amp;1\r\n        }\r\n        \r\n        if ($CustomField.Exception) {\r\n            throw $CustomField\r\n        }\r\n    }\r\n}\r\nprocess {\r\n    $Ticks = try {\r\n        # Get boot time from performance event logs\r\n        $PerfTicks = Get-WinEvent -FilterHashtable @{LogName = \"Microsoft-Windows-Diagnostics-Performance\/Operational\"; Id = 100 } -MaxEvents 1 -ErrorAction SilentlyContinue | ForEach-Object {\r\n            # Convert the event to XML and grab the Event node\r\n            $eventXml = ([xml]$_.ToXml()).Event\r\n            # Output boot time in ms\r\n            [int64]($eventXml.EventData.Data | Where-Object { $_.Name -eq 'BootTime' }).InnerXml\r\n        }\r\n        # Get the boot POST time from the firmware, when available\r\n        $FirmwareTicks = Get-ItemPropertyValue -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power\" -Name \"FwPOSTTime\" -ErrorAction SilentlyContinue\r\n        # Get the boot POST time from Windows, used as fall back\r\n        $OsTicks = Get-ItemPropertyValue -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power\" -Name \"POSTTime\" -ErrorAction SilentlyContinue\r\n        # Use most likely to be accurate to least accurate\r\n        if ($FirmwareTicks -gt 0) {\r\n            $FirmwareTicks\r\n        }\r\n        elseif ($OsTicks -gt 0) {\r\n            $OsTicks\r\n        }\r\n        elseif ($PerfTicks -and $PerfTicks -gt 0) {\r\n            $PerfTicks\r\n        }\r\n        else {\r\n            # Fall back to reading System event logs\r\n            $StartOfBoot = Get-WinEvent -FilterHashtable @{LogName = 'System'; Id = 12 } -MaxEvents 1 | Select-Object -ExpandProperty TimeCreated\r\n            $LastUpTime = Get-WmiObject Win32_OperatingSystem -ErrorAction Stop | Select-Object @{Label = 'LastBootUpTime'; Expression = { $_.ConvertToDateTime($_.LastBootUpTime) } } | Select-Object -ExpandProperty LastBootUpTime\r\n            New-TimeSpan -Start $LastUpTime -End $StartOfBoot -ErrorAction Stop | Select-Object -ExpandProperty TotalMilliseconds\r\n        }\r\n    }\r\n    catch {\r\n        Write-Host \"[Error] Failed to get Last BIOS Time from registry.\"\r\n        exit 2\r\n    }\r\n\r\n    $TimeSpan = [TimeSpan]::FromMilliseconds($Ticks)\r\n\r\n    $BootTime = if ($TimeSpan.Days -gt 0) {\r\n        \"$($TimeSpan.Days)d, $($TimeSpan.Hours)h, $($TimeSpan.Minutes)m, $($TimeSpan.Seconds + [Math]::Round($TimeSpan.Milliseconds \/ 1000, 1))s\"\r\n    }\r\n    elseif ($TimeSpan.Hours -gt 0) {\r\n        \"$($TimeSpan.Hours)h, $($TimeSpan.Minutes)m, $($TimeSpan.Seconds + [Math]::Round($TimeSpan.Milliseconds \/ 1000, 1))s\"\r\n    }\r\n    elseif ($TimeSpan.Minutes -gt 0) {\r\n        \"$($TimeSpan.Minutes)m, $($TimeSpan.Seconds + [Math]::Round($TimeSpan.Milliseconds \/ 1000, 1))s\"\r\n    }\r\n    elseif ($TimeSpan.Seconds -gt 0) {\r\n        \"$($TimeSpan.Seconds + [Math]::Round($TimeSpan.Milliseconds \/ 1000, 1))s\"\r\n    }\r\n    else {\r\n        # Fail safe output\r\n        \"$($TimeSpan.Days)d, $($TimeSpan.Hours)h, $($TimeSpan.Minutes)m, $($TimeSpan.Seconds + [Math]::Round($TimeSpan.Milliseconds \/ 1000, 1))s\"\r\n    }\r\n\r\n    Write-Host \"Last BIOS Time: $BootTime\"\r\n\r\n    if ($BootCustomField) {\r\n        Set-NinjaProperty -Name $BootCustomField -Type Text -Value $BootTime\r\n    }\r\n\r\n    if ($Seconds -gt 0) {\r\n        if ($TimeSpan.TotalSeconds -gt $Seconds) {\r\n            Write-Host \"[Error] Boot time exceeded threshold of $($Seconds)s by $($TimeSpan.TotalSeconds - $Seconds)s. Boot time: $BootTime\"\r\n            exit 1\r\n        }\r\n        Write-Host \"[Info] Boot time under threshold of $($Seconds)s by $($Seconds - $TimeSpan.TotalSeconds)s. Boot time: $BootTime\"\r\n    }\r\n    exit 0\r\n}\r\nend {\r\n    \r\n    \r\n    \r\n}<\/pre>\n<p>&nbsp;<\/p>\n\n<h2>An\u00e1lisis detallado<\/h2>\n<p>El script PowerShell proporcionado est\u00e1 dise\u00f1ado para obtener la \u00daltima hora del BIOS de un sistema Windows y alertar al usuario si supera un umbral especificado. Adem\u00e1s, puede guardar el resultado en un campo personalizado con fines de documentaci\u00f3n. A continuaci\u00f3n se explica paso a paso c\u00f3mo funciona el script.<\/p>\n<h2><em>Explicaci\u00f3n paso a paso<\/em><\/h2>\n<h3>1. Definici\u00f3n de par\u00e1metros:<\/h3>\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\">El script comienza definiendo dos par\u00e1metros: $Seconds y $BootCustomField.<\/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\">$Seconds especifica el umbral para el tiempo de arranque.<\/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\">$BootCustomField es un campo personalizado donde se puede guardar el tiempo de arranque.<\/li>\n<\/ul>\n<h3>2. Comprobaci\u00f3n de variables de entorno:<\/h3>\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=\"4\" data-aria-level=\"2\">El script comprueba las variables de entorno bootCustomField y bootTimeThreshold.<\/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=\"5\" data-aria-level=\"2\">Si se establecen, anulan los par\u00e1metros del script.<\/li>\n<\/ul>\n<h3>3. Funci\u00f3n Set-NinjaProperty:<\/h3>\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=\"6\" data-aria-level=\"2\">Esta funci\u00f3n se utiliza para establecer el valor del tiempo de arranque en un campo personalizado especificado.<\/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=\"7\" data-aria-level=\"2\">Incluye validaci\u00f3n para garantizar que el valor no supera los l\u00edmites de caracteres y gestiona adecuadamente los distintos tipos de datos.<\/li>\n<\/ul>\n<h3>4. Bloque de proceso:<\/h3>\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=\"8\" data-aria-level=\"2\">El script recupera la \u00daltima hora del BIOS usando varios m\u00e9todos, priorizando la precisi\u00f3n:<\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0a7\" data-font=\"Wingdings\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:2160,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Wingdings&quot;,&quot;469769242&quot;:[9642],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0a7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"1\" data-aria-level=\"3\">Registros de eventos de rendimiento.<\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0a7\" data-font=\"Wingdings\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:2160,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Wingdings&quot;,&quot;469769242&quot;:[9642],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0a7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"2\" data-aria-level=\"3\">Valores de registro para el tiempo POST del firmware.<\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0a7\" data-font=\"Wingdings\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:2160,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Wingdings&quot;,&quot;469769242&quot;:[9642],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0a7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"3\" data-aria-level=\"3\">Registros de eventos del sistema como alternativa.<\/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=\"9\" data-aria-level=\"2\">La hora obtenida se convierte a un formato legible para el ser humano.<\/li>\n<\/ul>\n<h3>5. Salida y alertas:<\/h3>\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=\"10\" data-aria-level=\"2\">El script muestra la \u00faltima hora del BIOS.<\/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=\"11\" data-aria-level=\"2\">Si se especifica un campo personalizado, establece este valor utilizando la funci\u00f3n Set-NinjaProperty.<\/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=\"12\" data-aria-level=\"2\">Si se establece un umbral, compara el tiempo de arranque con este umbral y alerta si se supera.<\/li>\n<\/ul>\n<h2>Posibles casos de uso<\/h2>\n<p>Imagina a un profesional de TI llamado Alex, que gestiona una flota de port\u00e1tiles de la empresa. Un d\u00eda, Alex se da cuenta de que varios usuarios informan de tiempos de arranque inusualmente largos. Desplegando este script PowerShell a trav\u00e9s de la red, Alex puede obtener y monitorizar autom\u00e1ticamente la \u00daltima hora del BIOS para cada sistema.<\/p>\n<p>Si alg\u00fan sistema supera el umbral predefinido, Alex recibe inmediatamente una alerta y puede investigar m\u00e1s a fondo, identificando potencialmente problemas de hardware o configuraciones err\u00f3neas que deban solucionarse.<\/p>\n<h2>Comparaciones<\/h2>\n<p>Otros m\u00e9todos para lograr resultados similares podr\u00edan incluir el uso de herramientas integradas de Windows o software de terceros. Sin embargo, estos enfoques a menudo carecen de las capacidades de personalizaci\u00f3n y automatizaci\u00f3n de un script PowerShell. Por ejemplo:<\/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\"><strong>Herramientas integradas<\/strong>: herramientas como el Administrador de Tareas pueden mostrar la \u00daltima Hora del BIOS pero no proporcionan alertas o automatizaci\u00f3n.<\/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\"><strong>Software de terceros<\/strong>: aunque pueden ofrecer una supervisi\u00f3n exhaustiva, pueden tener un coste m\u00e1s elevado y requerir una configuraci\u00f3n adicional.<\/li>\n<\/ul>\n<h2>FAQ<\/h2>\n<h3>P: \u00bfQu\u00e9 ocurre si el script no consigue recuperar la \u00faltima hora del BIOS?<\/h3>\n<p>R: El script incluye varios m\u00e9todos alternativos para garantizar que la \u00faltima hora del BIOS se recupere con precisi\u00f3n. Si todos los m\u00e9todos fallan, muestra un mensaje de error.<\/p>\n<h3>P: \u00bfPuedo modificar el umbral despu\u00e9s de desplegar el script?<\/h3>\n<p>R: S\u00ed, puedes establecer el umbral utilizando el par\u00e1metro -Seconds o estableciendo la variable de entorno bootTimeThreshold.<\/p>\n<h3>P: \u00bfC\u00f3mo puedo guardar la \u00daltima hora del BIOS en un campo personalizado?<\/h3>\n<p>R: Utiliza el par\u00e1metro -BootCustomField para especificar el campo personalizado donde debe guardarse la hora de arranque.<\/p>\n<h2>Implicaciones<\/h2>\n<p>Supervisar la \u00faltima hora del BIOS puede tener un impacto significativo en la seguridad y el rendimiento <a href=\"https:\/\/www.ninjaone.com\/es\/los-5-pilares-de-la-seguridad-informatica\" target=\"_blank\" rel=\"noopener\">inform\u00e1tico<\/a>. Un tiempo prolongado del BIOS podr\u00eda indicar problemas subyacentes que podr\u00edan afectar a la estabilidad general del sistema y a la productividad del usuario. Al supervisar y abordar estos problemas de forma proactiva, los profesionales de TI pueden mantener un rendimiento \u00f3ptimo del sistema y reducir el tiempo de inactividad.<\/p>\n<h2>Recomendaciones<\/h2>\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\">Monitoriza regularmente la \u00daltima hora del BIOS utilizando este script para detectar posibles problemas a tiempo.<\/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=\"5\" data-aria-level=\"1\">Estableced umbrales realistas basados en el rendimiento t\u00edpico de tus sistemas.<\/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=\"6\" data-aria-level=\"1\">Documenta cualquier anomal\u00eda e invest\u00edgala r\u00e1pidamente para evitar problemas a largo plazo.<\/li>\n<\/ul>\n<h2>Reflexiones finales<\/h2>\n<p>En conclusi\u00f3n, este script PowerShell ofrece una soluci\u00f3n robusta para monitorizar la \u00daltima hora del BIOS, proporcionando informaci\u00f3n cr\u00edtica sobre el rendimiento del sistema. Al integrar este script en tus pr\u00e1cticas de gesti\u00f3n de TI, puedes garantizar que los sistemas funcionen sin problemas y <a href=\"https:\/\/www.ninjaone.com\/es\/eficiencia\" target=\"_blank\" rel=\"noopener\">con eficacia<\/a>. NinjaOne ofrece un conjunto de herramientas que pueden mejorar a\u00fan m\u00e1s tus operaciones de TI, proporcionando capacidades completas de supervisi\u00f3n y <a href=\"https:\/\/www.ninjaone.com\/es\/blog\/todo-sobre-automatizacion-de-ti\" target=\"_blank\" rel=\"noopener\">automatizaci\u00f3n<\/a> para mantener tus sistemas en plena forma.<\/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":[4262,4263],"class_list":["post-387175","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\/387175","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=387175"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/media?parent=387175"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/operating_system?post=387175"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/es\/wp-json\/wp\/v2\/use_cases?post=387175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}