{"id":437998,"date":"2025-03-26T07:02:33","date_gmt":"2025-03-26T07:02:33","guid":{"rendered":"https:\/\/www.ninjaone.com\/?post_type=script_hub&#038;p=437998"},"modified":"2025-03-31T13:53:41","modified_gmt":"2025-03-31T13:53:41","slug":"erstellung-von-berichten-ueber-benutzeraktivitaeten-in-ad","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/de\/script-hub\/erstellung-von-berichten-ueber-benutzeraktivitaeten-in-ad\/","title":{"rendered":"PowerShell-Guide: Wie man Active Directory-Benutzeraktivit\u00e4tsberichte f\u00fcr das IT-Management erstellen kann"},"content":{"rendered":"<h2>Die wichtigsten Erkenntnisse<\/h2>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"1\" data-aria-level=\"1\"><strong>Automatisierte Erstellung von Berichten \u00fcber Benutzeraktivit\u00e4ten in AD<\/strong>: Das Skript automatisiert den Prozess der Erstellung von Berichten \u00fcber Benutzeraktivit\u00e4ten in Active Directory.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"2\" data-aria-level=\"1\"><strong>Anpassbarer Zeitrahmen<\/strong>: Mit dem Parameter <strong>-NumberOfDays<\/strong> k\u00f6nnen Benutzer:innen die Anzahl der Tage f\u00fcr die \u00dcberwachung der Aktivit\u00e4t angeben.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"3\" data-aria-level=\"1\"><strong>Ausschluss von deaktivierten Benutzer:innen<\/strong>: Das Skript verf\u00fcgt \u00fcber eine Option zum Ausschluss deaktivierter Benutzer:innen aus dem Bericht, um genauere Daten zu erhalten.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"4\" data-aria-level=\"1\"><strong>Einfache Integration<\/strong>: Es l\u00e4sst sich gut in die bestehende IT-Infrastruktur integrieren, was f\u00fcr MSPs und IT-Expert:innen besonders vorteilhaft ist.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"5\" data-aria-level=\"1\"><strong>Verbesserte Sicherheit und Compliance<\/strong>: Das Skript liefert wichtige Daten f\u00fcr Compliance-Pr\u00fcfungen und Sicherheits\u00fcberwachung.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"6\" data-aria-level=\"1\"><strong>Effizienter als manuelle Methoden<\/strong>: Es ist weitaus effizienter als manuelle Methoden zur Verfolgung von Benutzeraktivit\u00e4ten.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"7\" data-aria-level=\"1\"><strong>Umsetzbare Erkenntnisse<\/strong>: Das Skript stellt verwertbare Einblicke in die Anmeldemuster und Kontoaktivit\u00e4ten der Benutzer:innen zur Verf\u00fcgung.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"8\" data-aria-level=\"1\"><strong>NinjaOne-Kompatibilit\u00e4t<\/strong>: Erg\u00e4nzt Tools wie NinjaOne und verbessert die IT-Verwaltungs- und Berichtsfunktionen.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"9\" data-aria-level=\"1\"><strong>Skript-Flexibilit\u00e4t<\/strong>: Bietet Anpassungsm\u00f6glichkeiten f\u00fcr verschiedene IT-Umgebungen und Anforderungen.<\/li>\n<\/ul>\n<h2>Vorwort<\/h2>\n<p><a href=\"https:\/\/www.ninjaone.com\/de\/rmm\/active-directory-management\/\">Active Directory (AD)<\/a> ist ein Eckpfeiler der IT-Infrastruktur von Unternehmen. Es verwaltet und authentifiziert Benutzeridentit\u00e4ten und den Zugriff auf Systemressourcen. Die Verfolgung der Benutzeraktivit\u00e4ten in AD ist f\u00fcr die Sicherheit und Effizienz entscheidend. Dies bringt uns zur Bedeutung von <a href=\"https:\/\/www.ninjaone.com\/de\/script-hub\/\">PowerShell-Skripten<\/a> beim Extrahieren relevanter Daten aus AD, genauer gesagt, zur Bedeutung von einem Skript, das Berichte \u00fcber aktive Benutzer:innen innerhalb eines bestimmten Zeitraums erstellt.<\/p>\n<h2>Kontext<\/h2>\n<p>Das besprochene Skript ist f\u00fcr IT-Expert:innen und <a href=\"https:\/\/www.ninjaone.com\/de\/was-ist-ein-msp\/\">Managed Service Provider (MSPs)<\/a> gedacht, die einen klaren \u00dcberblick \u00fcber die Benutzeraktivit\u00e4ten in AD ben\u00f6tigen. Es handelt sich um ein PowerShell-Skript, ein leistungsstarkes Tool zur Automatisierung von Windows-Verwaltungsaufgaben. Dieses Skript erstellt einen Bericht \u00fcber die Anzahl der aktiven Benutzer:innen, die sich in einem bestimmten Zeitraum angemeldet haben. Solche Einblicke sind von unsch\u00e4tzbarem Wert f\u00fcr Pr\u00fcfpfade, Compliance, Sicherheits\u00fcberwachung und Benutzerkontenverwaltung.<\/p>\n<h2>Das Skript zur Erstellung von Berichten \u00fcber Benutzeraktivit\u00e4ten in AD<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">#Requires -Version 5.1\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    Generates a report for the number of active users in active directory that have logged in the specified time frame.\r\n.DESCRIPTION\r\n    Generates a report for the number of active users in active directory that have logged in the specified time frame.\r\n\r\n.EXAMPLE\r\n    (No Parameters)\r\n    \r\n    Number of active users: 2\r\n    Total users (including active and inactive): 5\r\n    Percent Active: 40%\r\n\r\n    SamAccountName UserPrincipalName   mail           LastLogonDate      \r\n    -------------- -----------------   ----           -------------      \r\n    kbohlander     kbohlander@test.lan                6\/5\/2023 8:58:20 AM\r\n    tuser          tuser@test.lan      tuser@test.com 6\/6\/2023 8:30:23 AM\r\n\r\nPARAMETER: -NumberOfDays \"ReplaceWithAnumber\"\r\n    How long ago in days to report on.\r\n.EXAMPLE\r\n    -NumberOfDays \"1\" (If today was 6\/7\/2023)\r\n    \r\n    Number of active users: 2\r\n    Total users (including active and inactive): 5\r\n    Percent Active: 40%\r\n\r\n    SamAccountName UserPrincipalName   mail           LastLogonDate      \r\n    -------------- -----------------   ----           -------------      \r\n    tuser          tuser@test.lan      tuser@test.com 6\/6\/2023 8:30:23 AM\r\n\r\nPARAMETER: -ExcludeDisabledUsers\r\n    Excludes the user from the report if they're currently disabled.\r\n\r\nPARAMETER: -CustomFieldName \"ReplaceMeWithAnyMultilineCustomField\"\r\n    Name of a multiline custom field to save the results to.\r\n.EXAMPLE\r\n    -CustomFieldName \"ReplaceMeWithAnyMultilineCustomField\"\r\n    \r\n    Number of active users: 2\r\n    Total users (including active and inactive): 5\r\n    Percent Active: 40%\r\n\r\n    SamAccountName UserPrincipalName   mail           LastLogonDate      \r\n    -------------- -----------------   ----           -------------      \r\n    kbohlander     kbohlander@test.lan                6\/5\/2023 8:58:20 AM\r\n    tuser          tuser@test.lan      tuser@test.com 6\/6\/2023 8:30:23 AM\r\n.OUTPUTS\r\n    None\r\n.NOTES\r\n    Minimum OS Architecture Supported: Windows 10, Windows Server 2016\r\n    Release Notes: Renamed script and added Script Variable support\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    [Parameter()]\r\n    [int]$NumberOfDays = 30,\r\n    [Parameter()]\r\n    [String]$CustomFieldName,\r\n    [Parameter()]\r\n    [Switch]$ExcludeDisabledUsers = [System.Convert]::ToBoolean($env:excludeDisabledUsersFromReport)\r\n)\r\n\r\nbegin {\r\n    # Tests for administrative rights which is required to get the last logon date.\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\r\n    # Tests if the device the script is running on is a dmona controller.\r\n    function Test-IsDomainController {\r\n        return $(Get-CimInstance -ClassName Win32_OperatingSystem).ProductType -eq 2\r\n    }\r\n\r\n    # This function is to make it easier to set Ninja Custom Fields.\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        # 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 we can set. If no type is given we'll assume the input doesn't have to be changed in any way.\r\n        $ValidFields = \"Attachment\", \"Checkbox\", \"Date\", \"Date or Date Time\", \"Decimal\", \"Dropdown\", \"Email\", \"Integer\", \"IP Address\", \"MultiLine\", \"MultiSelect\", \"Phone\", \"Secure\", \"Text\", \"Time\", \"URL\"\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 below field requires additional information in order to 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 we received some sort of error it should have an exception property and we'll exit the function 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 is expecting the time to be representing as a Unix Epoch string. So we'll convert what we were given into that format.\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 \"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\n    # Todays date\r\n    $Today = Get-Date\r\n\r\n    if ($env:numberOfDaysToReportOn -and $env:numberOfDaysToReportOn -notlike \"null\") { $NumberOfDays = $env:numberOfDaysToReportOn }\r\n    if ($env:customFieldName -and $env:customFieldName -notlike \"null\") { $CustomFieldName = $env:customFieldName }\r\n}\r\nprocess {\r\n    # Erroring out when ran without administrator rights\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    # Erroring out when ran on a non-domain controller\r\n    if (-not (Test-IsDomainController)) {\r\n        Write-Error -Message \"The script needs to be run on a domain controller!\"\r\n        exit 1\r\n    }\r\n\r\n    # If disabled users are to be excluded we're going to fetch different properties and Filter out disabled users\r\n    if ($ExcludeDisabledUsers) {\r\n        $Users = Get-ADUser -Filter * -Properties SamAccountName, UserPrincipalName, mail, LastLogonDate, Enabled | \r\n            Where-Object { $_.Enabled -eq $True }\r\n        $ActiveUsers = Get-ADUser -Filter { LastLogonDate -ge 0 } -Properties SamAccountName, UserPrincipalName, mail, LastLogonDate, Enabled |\r\n            Where-Object { (New-TimeSpan $_.LastLogonDate $Today).Days -le $NumberOfDays -and $_.Enabled -eq $True } |\r\n            Select-Object SamAccountName, UserPrincipalName, mail, LastLogonDate\r\n    }\r\n    else {\r\n        $Users = Get-ADUser -Filter * -Properties SamAccountName, UserPrincipalName, mail, LastLogonDate\r\n        $ActiveUsers = Get-ADUser -Filter { LastLogonDate -ge 0 } -Properties SamAccountName, UserPrincipalName, mail, LastLogonDate |\r\n            Where-Object { (New-TimeSpan $_.LastLogonDate $Today).Days -le $NumberOfDays } |\r\n            Select-Object SamAccountName, UserPrincipalName, mail, LastLogonDate\r\n    }\r\n\r\n    # Creating a generic list to start assembling the report\r\n    $Report = New-Object System.Collections.Generic.List[string]\r\n\r\n    # Actual report assembly each section will be print on its own line\r\n    $Report.Add(\"Active users: $(($ActiveUsers | Measure-Object).Count)\")\r\n    $Report.Add(\"Total users: $(($Users | Measure-Object).Count)\")\r\n    $Report.Add(\"Percent Active: $(if((($Users | Measure-Object).Count) -gt 0){[Math]::Round(($ActiveUsers | Measure-Object).Count \/ (($Users | Measure-Object).Count) * 100, 2)}else{0})%\")\r\n\r\n    # Set's up table to use in the report\r\n    $Report.Add($($ActiveUsers | Format-Table | Out-String))\r\n\r\n    if ($ActiveUsers) {\r\n        # Exports report to activity log\r\n        $Report | Write-Host\r\n\r\n        if ($CustomFieldName) {\r\n            # Saves report to custom field.\r\n            try {\r\n                Set-NinjaProperty -Name $CustomFieldName -Value ($Report | Out-String)\r\n            }\r\n            catch {\r\n                # If we ran into some sort of error we'll output it here.\r\n                Write-Error -Message $_.ToString() -Category InvalidOperation -Exception (New-Object System.Exception)\r\n                exit 1\r\n            }\r\n        }\r\n    }\r\n    else {\r\n        Write-Error \"[Error] No active users found!\"\r\n        exit 1\r\n    }\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>Greifen Sie auf \u00fcber 300 Skripte im NinjaOne Dojo zu.<\/p>\n<p><a href=\"https:\/\/www.ninjaone.com\/freetrialform\/\">Zugang erhalten<\/a><\/p>\n<\/div>\n<h2>Detaillierte Aufschl\u00fcsselung<\/h2>\n<p>Das Skript ist in verschiedene Abschnitte gegliedert:<\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"10\" data-aria-level=\"1\"><strong>Parameter<\/strong>: Es akzeptiert Parameter wie die Anzahl der Tage f\u00fcr die \u00dcberpr\u00fcfung auf aktive Benutzer:innen, den Namen eines benutzerdefinierten Feldes zum Speichern der Ergebnisse und eine Option zum Ausschluss deaktivierter Benutzer:innen.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"11\" data-aria-level=\"1\"><strong>Vorbereitung<\/strong>: Es \u00fcberpr\u00fcft auf die notwendigen Bedingungen wie Administratorrechte und das Vorhandensein eines Domain-Controllers.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"12\" data-aria-level=\"1\"><strong>Sammlung von Benutzerdaten<\/strong>: Es verwendet Active Directory-Cmdlets (<strong>Get-ADUser<\/strong>), um Benutzerdaten auf der Grundlage der angegebenen Parameter zu erfassen.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"12\" data-aria-level=\"1\"><strong>Erstellung von Berichten<\/strong>: Es erstellt ein Listenobjekt und f\u00fcllt es mit Benutzerdaten, wobei die Anzahl der aktiven Benutzer:innen, beziehungsweise aller Benutzer:innen, und der Prozentsatz der aktiven Benutzer:innen berechnet werden.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"12\" data-aria-level=\"1\"><strong>Ausgaben-Management<\/strong>: Das Skript zeigt den Bericht entweder auf der Konsole an oder speichert ihn mit der Funktion <strong>Set-NinjaProperty<\/strong> in einem benutzerdefinierten Feld.<\/li>\n<\/ul>\n<h2>M\u00f6gliche Anwendungsf\u00e4lle<\/h2>\n<p>Stellen Sie sich einen IT-Administrator in einem gro\u00dfen Unternehmen vor, der regelm\u00e4\u00dfig die Benutzeraktivit\u00e4ten im Hinblick auf die Einhaltung von Sicherheitsvorschriften \u00fcberpr\u00fcfen muss. Sie k\u00f6nnten dieses Skript f\u00fcr eine monatliche Ausf\u00fchrung einplanen, um einen klaren \u00dcberblick \u00fcber die Benutzeranmeldungen zu erhalten und so inaktive Konten oder ungew\u00f6hnliche Aktivit\u00e4tsmuster zu erkennen.<\/p>\n<h2>Vergleiche<\/h2>\n<p>Andere Methoden, wie manuelle Pr\u00fcfungen oder die Verwendung von GUI-basierten Tools, sind zeitaufw\u00e4ndig und im Vergleich zu PowerShell-Skripten weniger effizient. Skripte k\u00f6nnen automatisiert und angepasst werden, und sie verarbeiten gro\u00dfe Datens\u00e4tze schneller.<\/p>\n<h2>FAQs<\/h2>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"3\" data-aria-level=\"1\"><strong>Wie kann ich den Zeitrahmen f\u00fcr den Bericht anpassen?<\/strong>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"3\" data-aria-level=\"1\">Verwenden Sie den Parameter <strong>-NumberOfDays<\/strong>, um den gew\u00fcnschten Zeitrahmen festzulegen.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"4\" data-aria-level=\"1\"><strong>Kann das Skript deaktivierte Benutzer:innen ausschlie\u00dfen?<\/strong>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"4\" data-aria-level=\"1\">Ja, verwenden Sie den Parameter <strong>-ExcludeDisabledUsers<\/strong>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"5\" data-aria-level=\"1\"><strong>Ist es m\u00f6glich, den Bericht zu Dokumentationszwecken zu speichern?<\/strong>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"5\" data-aria-level=\"1\">Ja, benutzen Sie den Parameter <strong>-CustomFieldName<\/strong>, um den Bericht in einem benutzerdefinierten Feld zu speichern.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Folgen<\/h2>\n<p>Die Ergebnisse dieses Skripts k\u00f6nnen bei der Erkennung von Sicherheitsrisiken wie inaktiven Benutzerkonten oder unregelm\u00e4\u00dfigen Anmeldemustern hilfreich sein. Au\u00dferdem hilft es, die Einhaltung verschiedener IT-Richtlinien und -Vorschriften zu gew\u00e4hrleisten.<\/p>\n<h2>Empfehlungen<\/h2>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"6\" data-aria-level=\"1\">F\u00fchren Sie das Skript regelm\u00e4\u00dfig f\u00fcr eine konsequente \u00dcberwachung aus.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"7\" data-aria-level=\"1\">F\u00fchren Sie das Skript immer mit den entsprechenden Berechtigungen aus.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"8\" data-aria-level=\"1\">Nehmen Sie die Anpassungsoptionen in Anspruch, um den Bericht auf Ihre speziellen Bed\u00fcrfnisse anzupassen.<\/li>\n<\/ul>\n<h2>Abschlie\u00dfende \u00dcberlegungen<\/h2>\n<p>Die Integration dieses Skripts in NinjaOne, eine Plattform, die f\u00fcr ihre robusten <a href=\"https:\/\/www.ninjaone.com\/de\/it-management-fuer-unternehmen\/\">IT-Management-Funktionen<\/a> bekannt ist, kann die bestehenden Funktionen erg\u00e4nzen, indem das Skript detaillierte Einblicke in die Benutzeraktivit\u00e4ten in AD bietet. Es ist ein perfektes Beispiel daf\u00fcr, wie PowerShell-Skripte die Funktionalit\u00e4t umfassender IT-Verwaltungstools wie NinjaOne erweitern und tiefere Einblicke und Automatisierungsfunktionen bieten k\u00f6nnen.<\/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":[4309],"class_list":["post-437998","script_hub","type-script_hub","status-publish","hentry","script_hub_category-windows"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/script_hub\/437998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/script_hub"}],"about":[{"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/types\/script_hub"}],"author":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/comments?post=437998"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/media?parent=437998"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/operating_system?post=437998"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/use_cases?post=437998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}