Demo ansehen×
×

Sehen Sie NinjaOne in Aktion!

Mit dem Absenden dieses Formulars akzeptiere ich die Datenschutzerklärung von NinjaOne.

So deaktivieren Sie Autorun in Windows: Ein PowerShell-Skript für IT-Profis und MSPs

In den Weiten der modernen Unternehmenstechnologie haben IT-Experten und Managed Service Provider (MSPs) ständig mit Sicherheitsfragen zu kämpfen. Eine einfache, aber wichtige Aufgabe wie die Deaktivierung der Autorun-Funktion (Autoplay) auf Windows-Laufwerken kann die Systemsicherheit entscheidend verbessern. Wer auf der Suche nach einem effizienten Skript zum Deaktivieren von Autorun ist, wird hier fündig. Im Folgenden wird ein PowerShell-Skript vorgestellt, das genau das tut, und seine Auswirkungen auf IT-Experten und MSPs diskutiert.

Das Skript „Autorun deaktivieren“ verstehen

Dieses PowerShell-Skript dient einem einfachen Zweck: der Deaktivierung der Autorun- oder Autoplay-Funktion auf allen Windows-Laufwerken.

Kurze Zusammenfassung des Drehbuchs:

  • Was es bewirkt: Deaktiviert Autorun (Autoplay) auf allen Laufwerken.
  • Voraussetzungen: Windows 10 oder Windows Server 2016 und höher, PowerShell v5.1
  • Verwendung: Es ist ziemlich einfach auszuführen: PS C:> Disable-Autorun.ps1

Das Skript

#Requires -Version 5.1

<#
.SYNOPSIS
    Disables Autorun(Autoplay) on all drives.
.DESCRIPTION
    Disables Autorun(Autoplay) on all drives.
.EXAMPLE
    No parameters needed.
.EXAMPLE
    PS C:> Disable-Autorun.ps1
    No parameters needed.
.OUTPUTS
    None
.NOTES
    Minimum OS Architecture Supported: Windows 10, Windows Server 2016
    Release Notes:
    Initial Release
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.
    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. 
    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. 
    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. 
    Warranty Disclaimer: The script is provided “as is” and “as available”, 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. 
    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. 
    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. 
    EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).
.COMPONENT
    DataIOSecurity
#>

[CmdletBinding()]
param ()

begin {
    function Test-IsElevated {
        $id = [System.Security.Principal.WindowsIdentity]::GetCurrent()
        $p = New-Object System.Security.Principal.WindowsPrincipal($id)
        if ($p.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator))
        { Write-Output $true }
        else
        { Write-Output $false }
    }
    function Set-ItemProp {
        param (
            $Path,
            $Name,
            $Value,
            [ValidateSet("DWord", "QWord", "String", "ExpandedString", "Binary", "MultiString", "Unknown")]
            $PropertyType = "DWord"
        )
        New-Item -Path $Path -Force | Out-Null
        if ((Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue)) {
            Set-ItemProperty -Path $Path -Name $Name -Value $Value -Force -Confirm:$false | Out-Null
        }
        else {
            New-ItemProperty -Path $Path -Name $Name -Value $Value -PropertyType $PropertyType -Force -Confirm:$false | Out-Null
        }
    }
}
process {
    if (-not (Test-IsElevated)) {
        Write-Error -Message "Access Denied. Please run with Administrator privileges."
        exit 1
    }
    $Path = 'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionpoliciesExplorer'
    $Name = "NoDriveTypeAutorun"
    $Value = 0xFF
    # Sets NoDriveTypeAutorun to 0xFF
    Set-ItemProp -Path $Path -Name $Name -Value $Value
}
end {}

 

Zugriff auf über 300 Skripte im NinjaOne Dojo

Zugang erhalten

Warum die Deaktivierung von Autorun wichtig ist

  • Minimiertes Risiko von Malware: Wenn Autorun aktiviert ist, kann schädliche Software automatisch von USB- oder anderen externen Laufwerken ausgeführt werden. Durch die Deaktivierung dieser Funktion trägt das Skript dazu bei, das Risiko der Verbreitung von Malware in vernetzten Systemen zu verringern.
  • Optimierte Benutzererfahrung: Für IT- und MSPs, die große vernetzte Systeme verwalten, ist es entscheidend, eine konsistente Benutzererfahrung zu gewährleisten. Die Beseitigung unerwarteter Autorun-Popups oder automatisch startender Software trägt zu dieser Konsistenz bei.
  • Einfache Bereitstellung: Das bereitgestellte Skript zum Deaktivieren von Autorun kann problemlos auf mehreren Systemen in einer Unternehmensumgebung eingesetzt werden und ist somit ein leistungsstarkes Werkzeug für die Verwaltung von Massensystemen.

Die potenziellen Risiken der Deaktivierung von Autorun

  • Die Benutzer:innen können möglicherweise keine ausführbaren Dateien von USB-Laufwerken ausführen.
  • Die Benutzer:innen müssen möglicherweise jede Datei auf einem USB-Laufwerk manuell öffnen.
  • Manche Software funktioniert möglicherweise nicht richtig, wenn Autorun deaktiviert ist.

Andere Möglichkeiten, Autorun zu deaktivieren

Über die Windows-Registrierung:

  • Öffnen Sie den Registrierungseditor.
  • Navigieren Sie zu dem folgenden Schlüssel: HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer
  • Doppelklicken Sie auf den Wert NoDriveAutoRun.
  • Setzen Sie den Wert auf 1, um Autorun für alle Laufwerke zu deaktivieren.
  • Setzen Sie den Wert auf 2, um Autorun nur für Wechsellaufwerke zu deaktivieren.

Über die Gruppenrichtlinie:

  • Öffnen Sie die Verwaltungskonsole für Gruppenrichtlinien.
  • Navigieren Sie zu der folgenden Richtlinieneinstellung:
  • ComputerkonfigurationVerwaltungsvorlagenWindows-KomponentenAutoplay
  • Setzen Sie die Richtlinie auf Deaktiviert, um Autorun für alle Laufwerke zu deaktivieren.
  • Setzen Sie die Richtlinie auf Aktiviert, um Autorun nur für Wechsellaufwerke zu deaktivieren.

Abschließende Überlegungen

In der sich schnell entwickelnden IT-Welt sind es manchmal einfache Skripte, die den größten Einfluss haben können. Egal, ob Sie ein IT-Experte, ein MSP oder ein neugieriger Techniker sind, Tools wie das Skript zum Deaktivieren von Autoplay sind unerlässlich für Sie. In einer Welt, in der es von Cybersecurity-Bedrohungen nur so wimmelt, sind es die grundlegenden Vorsichtsmaßnahmen wie die Deaktivierung von Autorun auf einem Laufwerk, die sich oft als besonders wichtig erweisen.

Nächste Schritte

Der Aufbau eines effizienten und effektiven IT-Teams erfordert eine zentralisierte Lösung, die als vereintes Tool für die Bereitstellung von Dienstleistungen fungiert. NinjaOne ermöglicht es IT-Teams, all ihre Geräte zu überwachen, verwalten, sichern und zu unterstützen, unabhängig von ihrem Ort und komplexer Infrastruktur vor Ort.

Erfahren Sie mehr über NinjaOne Endpoint Management schauen Sie sich eine Live-Tour an oder starten Sie Ihre kostenlose Testversion der NinjaOne Plattform.

Kategorien:

Das könnte Sie auch interessieren

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • 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.
  • 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.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, 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.
  • 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.
  • 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.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).