Bekijk een demo×
×

Zie NinjaOne in actie!

Door dit formulier in te dienen geef ik aan akkoord te gaan met het privacybeleid van NinjaOne.

Hoe Autorun Uitschakelen in Windows: Een PowerShell-script voor IT-professionals en MSP’s

In de uitgestrektheid van moderne bedrijfstechnologie worstelen IT-professionals en Managed Service Providers (MSP’s) voortdurend met beveiligingsproblemen. Een eenvoudige maar cruciale taak, zoals het uitschakelen van de Autorun-functie (Autoplay) op Windows-schijven, kan een game-changer zijn voor het verbeteren van de systeembeveiliging. Als je op zoek bent naar een efficiënt ‘schakel autorun uit-script’, zoek dan niet verder. Hieronder duiken we in een PowerShell-script dat precies dat doet en bespreken we de implicaties voor IT-professionals en MSP’s.

Het script ‘Autorun Uitschakelen’ begrijpen

Dit PowerShell-script, netjes gemaakt, dient een eenvoudig doel: het uitschakelen van de Autorun- of Autoplay-functie op alle Windows-stations. Op het eerste gezicht lijkt het misschien eenvoudig, maar de beveiligingswaarde die het biedt, vooral in bedrijfsomgevingen, is immens.

Korte samenvatting van het script:

  • Wat het doet: Schakelt Autorun (Autoplay) op alle stations uit.
  • Vereisten: Windows 10 of Windows Server 2016 en hoger, PowerShell v5.1
  • Gebruik: Het is vrij eenvoudig uit te voeren: PS C:> Disable-Autorun.ps1

Het Script

#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 {}

 

Toegang tot meer dan 300 scripts in de NinjaOne Dojo

Toegang krijgen

Waarom Autorun uitschakelen belangrijk is

  • Minimaal risico op malware: Als Autorun is ingeschakeld, kan schadelijke software automatisch worden uitgevoerd vanaf USB’s of andere externe stations. Door deze functie uit te schakelen, helpt het script bij het beperken van het risico dat malware zich over netwerksystemen verspreidt.
  • Gestroomlijnde gebruikerservaring: Voor IT en MSP’s die grote netwerksystemen beheren, is het cruciaal om een consistente gebruikerservaring te behouden. Het elimineren van onverwachte Autorun pop-ups of automatische softwarelanceringen draagt bij aan deze consistentie.
  • Eenvoudige implementatie: Het meegeleverde ‘schakel autorun uit-script’ kan eenvoudig worden ingezet op meerdere systemen in een bedrijfsomgeving, waardoor het een krachtig hulpmiddel is voor bulksysteembeheer.

De mogelijke risico’s van het uitschakelen van Autorun

  • Gebruikers kunnen mogelijk geen uitvoerbare bestanden uitvoeren vanaf USB-stations.
  • Gebruikers moeten mogelijk elk bestand op een USB-station handmatig openen.
  • Sommige software werkt mogelijk niet goed als Autorun is uitgeschakeld.

Andere manieren om Autorun uit te schakelen

Via het Windows-register:

  • Open de Register-editor.
  • Navigeer naar de volgende sleutel: HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer
  • Dubbelklik op de waarde NoDriveAutoRun.
  • Stel de waarde in op 1 om Autorun voor alle schijven uit te schakelen.
  • Stel de waarde in op 2 om Autorun alleen uit te schakelen voor verwisselbare schijven.

Via Groepsbeleid:

  • Open de Group Policy Management Console.
  • Navigeer naar de volgende beleidsinstelling:
  • Computer ConfigurationAdministrative TemplatesWindows ComponentsAutoplay
  • Stel het beleid in op Uitgeschakeld om Autorun voor alle stations uit te schakelen.
  • Stel het beleid in op Ingeschakeld om Autorun alleen uit te schakelen voor verwisselbare schijven.

Slotbeschouwingen:

In de snel evoluerende wereld van IT zijn het soms eenvoudige scripts die de grootste impact kunnen hebben. Of je nu een IT-professional, een MSP of een nieuwsgierige techneut bent, het is essentieel om tools zoals het ‘schakel autorun uit-script’ in je arsenaal te hebben. In een wereld die wemelt van de cyberbeveiligingsbedreigingen zijn het immers de basismaatregelen, zoals het uitschakelen van autorun op een schijf, die vaak het belangrijkst blijken te zijn.

Volgende stappen

Het opbouwen van een efficiënt en effectief IT-team vereist een gecentraliseerde oplossing die fungeert als uw kerndienstleveringstool. NinjaOne stelt IT-teams in staat om al hun apparaten te monitoren, beheren, beveiligen en ondersteunen, waar ze ook zijn, zonder de noodzaak van complexe on-premises infrastructuur.

Leer meer over NinjaOne Endpoint Management, bekijk een live rondleiding, of start uw gratis trial van het NinjaOne-platform

Categorieën:

Dit vindt u misschien ook leuk

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).