{"id":394176,"date":"2024-12-17T09:44:01","date_gmt":"2024-12-17T09:44:01","guid":{"rendered":"https:\/\/www.ninjaone.com\/?post_type=script_hub&#038;p=394176"},"modified":"2024-12-17T09:44:01","modified_gmt":"2024-12-17T09:44:01","slug":"ordinateurs-inactifs-ad","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/fr\/script-hub\/ordinateurs-inactifs-ad\/","title":{"rendered":"Comment trouver des ordinateurs inactifs dans Active Directory \u00e0 l&rsquo;aide de PowerShell\u00a0?\u00a0"},"content":{"rendered":"<h2>Comprendre la n\u00e9cessit\u00e9 d&rsquo;identifier les ordinateurs inactifs dans Active Directory<\/h2>\n<p>Les <strong>ordinateurs inactifs dans AD (Active Directory) <\/strong>peuvent pr\u00e9senter des risques pour la s\u00e9curit\u00e9 et l&rsquo;efficacit\u00e9 de l&rsquo;entreprise. Ces machines peuvent ne plus exister physiquement, mais rester \u00e0 l&rsquo;\u00e9tat d&rsquo;entr\u00e9es dormantes, cr\u00e9ant un encombrement et des points d&rsquo;entr\u00e9e potentiels pour les <a href=\"https:\/\/www.ninjaone.com\/it-hub\/endpoint-security\/what-is-a-threat-actor\/\">acteurs malveillants.<\/a> L&rsquo;identification et la suppression r\u00e9guli\u00e8res de ces entr\u00e9es permettent de garantir un environnement <a href=\"https:\/\/www.ninjaone.com\/it-hub\/endpoint-management\/what-is-active-directory\/\">Active Directory<\/a> propre et s\u00e9curis\u00e9.<\/p>\n<p>Ce script <a href=\"https:\/\/www.ninjaone.com\/it-hub\/endpoint-management\/what-is-powershell\/\">PowerShell<\/a> automatise la t\u00e2che consistant \u00e0 localiser les ordinateurs inactifs depuis un certain nombre de jours. Il fournit aux professionnels de l&rsquo;informatique des informations exploitables et s&rsquo;int\u00e8gre m\u00eame aux champs personnalis\u00e9s de NinjaOne pour des rapports rationalis\u00e9s.<\/p>\n<h2>Le script\u00a0:<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">#Requires -Version 5.1\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    Gets computers that have been inactive for a specified number of days.\r\n.DESCRIPTION\r\n    Gets computers that have been inactive for a specified number of days.\r\n    The number of days to consider a computer inactive can be specified as a parameter or saved to a custom field.\r\n\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\r\nPARAMETER: -InactiveDays 30\r\n    The number of days to consider a computer inactive. Computers that have been inactive for this number of days will be included in the report.\r\n.EXAMPLE\r\n    -InactiveDays 30\r\n    ## EXAMPLE OUTPUT WITH InactiveDays ##\r\n    [Info] Searching for computers that are inactive for 30 days or more.\r\n    [Info] Found 11 inactive computers.\r\n\r\nPARAMETER: -InactiveDays 30 -WysiwygCustomField \"ReplaceMeWithAnyWysiwygCustomField\"\r\n    The number of days to consider a computer inactive. Computers that have been inactive for this number of days will be included in the report.\r\n.EXAMPLE\r\n    -InactiveDays 30 -WysiwygCustomField \"ReplaceMeWithAnyWysiwygCustomField\"\r\n    ## EXAMPLE OUTPUT WITH WysiwygCustomField ##\r\n    [Info] Searching for computers that are inactive for 30 days or more.\r\n    [Info] Found 11 inactive computers.\r\n    [Info] Attempting to set Custom Field 'Inactive Computers'.\r\n    [Info] Successfully set Custom Field 'Inactive Computers'!\r\n\r\n.NOTES\r\n    Minimum OS Architecture Supported: Windows Server 2016\r\n    Release Notes: Initial Release\r\n#&gt;\r\n\r\n[CmdletBinding()]\r\nparam (\r\n    [Parameter()]\r\n    $InactiveDays,\r\n    [Parameter()]\r\n    [String]$WysiwygCustomField\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 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 types 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    if (-not (Test-IsElevated)) {\r\n        Write-Host \"[Error] Access Denied. Please run with Administrator privileges.\"\r\n        exit 1\r\n    }\r\n\r\n    # Get Script Variables and override parameters with them\r\n    if ($env:inactiveDays -and $env:inactiveDays -notlike \"null\") {\r\n        $InactiveDays = $env:inactiveDays\r\n    }\r\n    if ($env:wysiwygCustomField -and $env:wysiwygCustomField -notlike \"null\") {\r\n        $WysiwygCustomField = $env:wysiwygCustomField\r\n    }\r\n\r\n    # Parameter Requirements\r\n    if ([string]::IsNullOrWhiteSpace($InactiveDays)) {\r\n        Write-Host \"[Error] Inactive Days is required.\"\r\n        exit 1\r\n    }\r\n    elseif ([int]::TryParse($InactiveDays, [ref]$null) -eq $false) {\r\n        Write-Host \"[Error] Inactive Days must be a number.\"\r\n        exit 1\r\n    }\r\n\r\n    # Check that Active Directory module is available\r\n    if (-not (Get-Module -ListAvailable -Name ActiveDirectory)) {\r\n        Write-Host \"[Error] Active Directory module is not available. Please install it and try again.\"\r\n        exit 1\r\n    }\r\n\r\n    try {\r\n        # Get the date in the past $InactiveDays days\r\n        $InactiveDate = (Get-Date).AddDays(-$InactiveDays)\r\n        # Get the SearchBase for the domain\r\n        $Domain = \"DC=$(\r\n            $(Get-CimInstance Win32_ComputerSystem).Domain -split \"\\.\" -join \",DC=\"\r\n        )\"\r\n        Write-Host \"[Info] Searching for computers that are inactive for $InactiveDays days or more.\"\r\n\r\n        # For Splatting parameters into Get-ADComputer\r\n        $GetComputerSplat = @{\r\n            Property   = \"Name\", \"LastLogonTimeStamp\", \"OperatingSystem\"\r\n            # LastLogonTimeStamp is converted to a DateTime object from the Get-ADComputer cmdlet\r\n            Filter     = { (Enabled -eq \"true\") -and (LastLogonTimeStamp -le $InactiveDate) }\r\n            SearchBase = $Domain\r\n        }\r\n\r\n        # Get inactive computers that are not active in the past $InactiveDays days\r\n        $InactiveComputers = Get-ADComputer @GetComputerSplat | Select-Object \"Name\", @{\r\n            # Format the LastLogonTimeStamp property to a human-readable date\r\n            Name       = \"LastLogon\"\r\n            Expression = {\r\n                if ($_.LastLogonTimeStamp -gt 0) {\r\n                    # Convert LastLogonTimeStamp to a datetime\r\n                    $lastLogon = [DateTime]::FromFileTime($_.LastLogonTimeStamp)\r\n                    # Format the datetime\r\n                    $lastLogonFormatted = $lastLogon.ToString(\"MM\/dd\/yyyy hh:mm:ss tt\")\r\n                    return $lastLogonFormatted\r\n                }\r\n                else {\r\n                    return \"01\/01\/1601 00:00:00 AM\"\r\n                }\r\n            }\r\n        }, \"OperatingSystem\"\r\n\r\n        if ($InactiveComputers -and $InactiveComputers.Count -gt 0) {\r\n            Write-Host \"[Info] Found $($InactiveComputers.Count) inactive computers.\"\r\n        }\r\n        else {\r\n            Write-Host \"[Info] No inactive computers were found.\"\r\n        }\r\n    }\r\n    catch {\r\n        Write-Host \"[Error] Failed to get inactive computers. Please try again.\"\r\n        exit 1\r\n    }\r\n\r\n    # Save the results to a custom field\r\n    if ($WysiwygCustomField) {\r\n        try {\r\n            Write-Host \"[Info] Attempting to set Custom Field '$WysiwygCustomField'.\"\r\n            Set-NinjaProperty -Name $WysiwygCustomField -Value $($InactiveComputers | ConvertTo-Html -Fragment | Out-String)\r\n            Write-Host \"[Info] Successfully set Custom Field '$WysiwygCustomField'!\"\r\n        }\r\n        catch {\r\n            Write-Host \"[Error] Failed to set Custom Field '$WysiwygCustomField'.\"\r\n            $ExitCode = 1\r\n        }\r\n    }\r\n\r\n    $InactiveComputers | Format-Table -AutoSize | Out-String -Width 4000 | Write-Host\r\n\r\n    exit $ExitCode\r\n}\r\nend {\r\n    \r\n    \r\n    \r\n}<\/pre>\n<p>&nbsp;<\/p>\n\n<div class=\"in-context-cta\"><p>Gagnez du temps gr\u00e2ce \u00e0 plus de 300 scripts du Dojo NinjaOne.<\/p>\n<p>\u2192 <a class=\"waffle-rich-text-link\" href=\"https:\/\/www.ninjaone.com\/freetrialform\/\">Obtenir l&rsquo;acc\u00e8s<\/a><\/p>\n<\/div>\n<h2>Fonctionnement du script PowerShell<\/h2>\n<p>Ce script est con\u00e7u pour les professionnels de l&rsquo;informatique qui g\u00e8rent des environnements AD et n\u00e9cessite PowerShell 5.1 ou une version plus r\u00e9cente. Voici une description d\u00e9taill\u00e9e de son fonctionnement\u00a0:<\/p>\n<h3>Pr\u00e9requis<\/h3>\n<ul>\n<li><strong>Privil\u00e8ges administratifs<\/strong>\u00a0: Le script v\u00e9rifie l&rsquo;existence de privil\u00e8ges \u00e9lev\u00e9s, ce qui garantit qu&rsquo;il s&rsquo;ex\u00e9cute de mani\u00e8re s\u00fbre et efficace.<\/li>\n<li><strong>Module Active Directory<\/strong>\u00a0: Le script s&rsquo;appuie sur le module Active Directory PowerShell pour interagir avec les objets AD.<\/li>\n<li><strong>Configuration des champs personnalis\u00e9s (facultatif)<\/strong>\u00a0: Si vous utilisez NinjaOne, le script peut \u00e9crire les r\u00e9sultats dans un champ personnalis\u00e9 pour faciliter le suivi.<\/li>\n<\/ul>\n<h3>Composants cl\u00e9s<\/h3>\n<ol>\n<li><strong>Traitement des param\u00e8tres<\/strong>\u00a0:<br \/>\nLe script accepte deux param\u00e8tres\u00a0:<\/p>\n<ol style=\"list-style-type: lower-alpha;\">\n<li>-InactiveDays : sp\u00e9cifie le seuil (en jours) \u00e0 partir duquel un ordinateur est consid\u00e9r\u00e9 comme inactif.<\/li>\n<li>-WysiwygCustomField\u00a0: param\u00e8tre optionnel pour enregistrer les r\u00e9sultats dans un champ personnalis\u00e9 dans NinjaOne.<\/li>\n<\/ol>\n<\/li>\n<li><strong>Remplacement des variables d&rsquo;environnement<\/strong>\u00a0:<br \/>\nLe script peut extraire des valeurs de configuration des variables d&rsquo;environnement, ce qui permet des ajustements dynamiques sans codage en dur des param\u00e8tres.<\/li>\n<li><strong>Recherche informatique inactive<\/strong>\u00a0:<br \/>\nAvec \u00ab\u00a0Get-ADComputer\u00a0\u00bb, le script recherche dans AD les ordinateurs dont le LastLogonTimeStamp (horodatage de la derni\u00e8re connexion) est plus ancien que le seuil sp\u00e9cifi\u00e9. Il convertit le LastLogonTimeStamp dans un format lisible par l&rsquo;homme afin d&rsquo;am\u00e9liorer les rapports.<\/li>\n<li><strong>Int\u00e9gration de champs personnalis\u00e9s<\/strong>\u00a0:<br \/>\nSi l&rsquo;option -WysiwygCustomField est sp\u00e9cifi\u00e9e, le script utilise une fonction Set-NinjaProperty pour enregistrer les r\u00e9sultats au format HTML dans les champs personnalis\u00e9s de NinjaOne.<\/li>\n<li><strong>Gestion des erreurs<\/strong>\u00a0:<br \/>\nLe script comprend des contr\u00f4les d&rsquo;erreur efficaces pour la disponibilit\u00e9 des modules, la validation des param\u00e8tres et le traitement des r\u00e9sultats, ce qui garantit une ex\u00e9cution en toute simplicit\u00e9.<\/li>\n<\/ol>\n<h2>Cas d&rsquo;utilisation pratiques<\/h2>\n<h3>Sc\u00e9nario\u00a0: Nettoyer un r\u00e9seau dormant<\/h3>\n<p>Une entreprise MSP g\u00e9rant le r\u00e9seau d&rsquo;une entreprise de taille moyenne remarque un pic dans les \u00e9checs de connexion et soup\u00e7onne les comptes d&rsquo;ordinateur inactifs dans AD de contribuer aux vuln\u00e9rabilit\u00e9s de s\u00e9curit\u00e9. Gr\u00e2ce \u00e0 ce script, l&rsquo;\u00e9quipe informatique identifie rapidement les ordinateurs inactifs depuis plus de 60 jours et exporte les r\u00e9sultats pour examen. Gr\u00e2ce \u00e0 ces informations, ils nettoient AD, am\u00e9liorant ainsi l&rsquo;efficacit\u00e9 et la s\u00e9curit\u00e9 du r\u00e9seau.<\/p>\n<h3>Sc\u00e9nario\u00a0: Maintenance proactive<\/h3>\n<p>Une entreprise impl\u00e9mente le script dans le cadre de sa routine de maintenance trimestrielle, afin de s&rsquo;assurer que son Active Directory reste l\u00e9ger et \u00e0 jour. L&rsquo;int\u00e9gration du script avec NinjaOne permet \u00e0 l&rsquo;\u00e9quipe informatique de conserver un historique des ordinateurs inactifs \u00e0 des fins d&rsquo;audit.<\/p>\n<h2>Comparaison de ce script avec d&rsquo;autres m\u00e9thodes<\/h2>\n<h3>Requ\u00eates manuelles\u00a0:<\/h3>\n<p>Alors que les administrateurs informatiques peuvent interroger manuellement AD \u00e0 l&rsquo;aide de cmdlets PowerShell tels que \u00ab\u00a0Get-ADComputer\u00a0\u00bb, ce script automatise le processus, garantissant des r\u00e9sultats coh\u00e9rents et r\u00e9duisant les erreurs humaines.<\/p>\n<h3>Outils tiers\u00a0:<\/h3>\n<p>Les outils commerciaux de nettoyage AD offrent des fonctionnalit\u00e9s similaires mais ont un co\u00fbt. Ce script propose une alternative gratuite et personnalisable, avec l&rsquo;avantage suppl\u00e9mentaire d&rsquo;une int\u00e9gration avec NinjaOne.<\/p>\n<h3>Outils GUI int\u00e9gr\u00e9s\u00a0:<\/h3>\n<p>L&rsquo;utilisation des outils d&rsquo;administration AD pour cette t\u00e2che peut s&rsquo;av\u00e9rer fastidieuse et chronophage. Le script rationalise le processus, en particulier pour les environnements de grande taille.<\/p>\n<h2>Questions fr\u00e9quentes<\/h2>\n<h3>Puis-je utiliser ce script sans NinjaOne\u00a0?<\/h3>\n<p>Tout \u00e0 fait. Le script fonctionne de mani\u00e8re autonome pour identifier les ordinateurs inactifs. L&rsquo;int\u00e9gration de NinjaOne est facultative.<\/p>\n<h3>Comment le script d\u00e9termine-t-il l&rsquo;inactivit\u00e9\u00a0?<\/h3>\n<p>Il v\u00e9rifie l&rsquo;attribut LastLogonTimeStamp des comptes d&rsquo;ordinateur et le compare au seuil sp\u00e9cifi\u00e9.<\/p>\n<h3>Ce script peut-il \u00eatre utilis\u00e9 en toute s\u00e9curit\u00e9\u00a0?<\/h3>\n<p>Oui, mais veillez \u00e0 ce qu&rsquo;il fonctionne dans un environnement s\u00e9curis\u00e9 et avec les autorisations appropri\u00e9es. Testez dans un environnement de non-production si vous n&rsquo;\u00eates pas s\u00fbr.<\/p>\n<h3>Puis-je modifier le script pour d&rsquo;autres objets AD, comme les utilisateurs\u00a0?<\/h3>\n<p>Oui, en apportant des modifications mineures \u00e0 la cmdlet \u00ab\u00a0Get-ADComputer\u00a0\u00bb, vous pouvez cibler des utilisateurs ou d&rsquo;autres objets AD.<\/p>\n<h2>Ce qu&rsquo;implique l&rsquo;utilisation de ce script<\/h2>\n<p>Le nettoyage des ordinateurs inactifs r\u00e9duit la surface d&rsquo;attaque de votre r\u00e9seau, minimise l&rsquo;encombrement et am\u00e9liore les performances d&rsquo;Active Directory. En utilisant r\u00e9guli\u00e8rement ce script, les entreprises peuvent maintenir une s\u00e9curit\u00e9 plus stricte et assurer la conformit\u00e9 avec les politiques de gouvernance informatique.<\/p>\n<h2>Recommandations pour l&rsquo;utilisation de ce script<\/h2>\n<ol>\n<li><strong>Ex\u00e9cutez en tant qu&rsquo;administrateur<\/strong>\u00a0: veillez \u00e0 ex\u00e9cuter le script avec des privil\u00e8ges \u00e9lev\u00e9s.<\/li>\n<li><strong>Testez en environnement contr\u00f4l\u00e9<\/strong> avant de le d\u00e9ployer en production, testez le script dans un environnement contr\u00f4l\u00e9 pour vous assurer qu&rsquo;il fonctionne comme pr\u00e9vu.<\/li>\n<li><strong>Automatisez les processus<\/strong>\u00a0: Planifiez l&rsquo;ex\u00e9cution r\u00e9guli\u00e8re du script \u00e0 l&rsquo;aide du planificateur de t\u00e2ches ou d&rsquo;un outil similaire.<\/li>\n<li><strong>Utilisez-le avec NinjaOne<\/strong>\u00a0: Tirez parti de l&rsquo;int\u00e9gration pour maintenir des rapports complets au sein de votre plateforme RMM.<\/li>\n<\/ol>\n<h2>Conclusion<\/h2>\n<p>La gestion des ordinateurs inactifs dans Active Directory est une t\u00e2che essentielle pour les professionnels de l&rsquo;informatique. Ce script PowerShell fournit une solution efficace et flexible, automatisant le processus d&rsquo;identification et s&rsquo;int\u00e9grant de mani\u00e8re fluide avec NinjaOne pour un reporting am\u00e9lior\u00e9. En int\u00e9grant ces outils dans leurs flux de travail, les \u00e9quipes informatiques peuvent am\u00e9liorer la s\u00e9curit\u00e9, rationaliser les op\u00e9rations et maintenir un environnement Active Directory propre.<\/p>\n<p>Pour les professionnels de l&rsquo;informatique qui cherchent \u00e0 simplifier la gestion d&rsquo;AD, NinjaOne offre des outils puissants qui compl\u00e8tent les scripts de ce type, permettant une surveillance rationalis\u00e9e et une maintenance proactive.<\/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":[4285],"class_list":["post-394176","script_hub","type-script_hub","status-publish","hentry","script_hub_category-windows","use_cases-surveillance"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/script_hub\/394176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/script_hub"}],"about":[{"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/types\/script_hub"}],"author":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/comments?post=394176"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/media?parent=394176"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/operating_system?post=394176"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/fr\/wp-json\/wp\/v2\/use_cases?post=394176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}