{"id":388753,"date":"2024-12-06T11:33:45","date_gmt":"2024-12-06T11:33:45","guid":{"rendered":"https:\/\/www.ninjaone.com\/?post_type=script_hub&#038;p=388753"},"modified":"2024-12-06T11:33:45","modified_gmt":"2024-12-06T11:33:45","slug":"erstellung-von-desktop-verknuepfungen","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/de\/script-hub\/erstellung-von-desktop-verknuepfungen\/","title":{"rendered":"Schritt-f\u00fcr-Schritt-Guide: Wie man Desktop-Verkn\u00fcpfungen mit PowerShell erstellen kann"},"content":{"rendered":"<p>Die programmgesteuerte <strong>Erstellung von Desktop-Verkn\u00fcpfungen<\/strong> kann IT-Experten viel Zeit und M\u00fche ersparen, insbesondere bei der Verwaltung von Umgebungen mit mehreren Benutzer:innen. <a href=\"https:\/\/www.ninjaone.com\/de\/it-hub\/endpoint-management\/was-ist-powershell\/\" target=\"_blank\" rel=\"noopener\">PowerShell<\/a>, eine leistungsstarke, Windows-eigene Skriptsprache, bietet die Flexibilit\u00e4t und Funktionalit\u00e4t, um diese Aufgabe effizient zu automatisieren.<\/p>\n<p>In diesem Blogbeitrag wird ein umfassendes PowerShell-Skript zur Erstellung von Desktop-Verkn\u00fcpfungen f\u00fcr ausf\u00fchrbare Dateien vorgestellt, wobei die Verwendung, die Funktionalit\u00e4t und die Vorteile f\u00fcr IT-Experten und <a href=\"https:\/\/www.ninjaone.com\/de\/was-ist-ein-msp\" target=\"_blank\" rel=\"noopener\">Managed Service Provider (MSPs)<\/a> ausf\u00fchrlich beschrieben werden.<\/p>\n<h2>Kontext<\/h2>\n<p>In gro\u00dfen IT-Umgebungen kann die Verwaltung von Benutzer-Desktops und die Gew\u00e4hrleistung der Einheitlichkeit aller Systeme eine Herausforderung darstellen. Desktop-Verkn\u00fcpfungen sind ein einfacher, aber wesentlicher Bestandteil dieser Verwaltung, da sie einen schnellen Zugriff auf Anwendungen, Webseiten und Dateien erm\u00f6glichen.<\/p>\n<p>Die manuelle Erstellung dieser Verkn\u00fcpfungen f\u00fcr jeden Benutzer ist nicht praktikabel, insbesondere in Unternehmen mit zahlreichen Anwender:innen. Hier ist die Automatisierung mit PowerShell-Skripten von unsch\u00e4tzbarem Wert. Das Skript im Fokus erstellt nicht nur Verkn\u00fcpfungen, sondern erm\u00f6glicht auch die Anpassung mit Parametern wie Symbolpfaden, ausf\u00fchrbaren Argumenten und benutzerspezifischen Einstellungen.<\/p>\n<h2>Das Skript zur Erstellung von Desktop-Verkn\u00fcpfungen<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">&lt;#\r\n.SYNOPSIS\r\n    This script creates a desktop shortcut for an executable with specified options. It can create a shortcut for all users (including new ones) or for existing users only.\r\n.DESCRIPTION\r\n    This script creates a desktop shortcut for an executable with specified options. \r\n    It can create a shortcut for all users (including new ones) or for existing users only.\r\n\r\n    You can also provide a base64 string on line 79 enclosed in quotes and an icon directory, and the script will use that instead.\r\n.EXAMPLE\r\n    This will create a shortcut that opens www.google.com in Firefox on JohnSmith's desktop. This is not limited to just browsers; you can specify any executable you would normally be able to via the \"Create Shortcut\" menu.\r\n    \r\n    -Name \"ERP App\" -EXEPath \"C:\\Program Files\\Mozilla Firefox\\firefox.exe\" -StartIn \"C:\\Program Files\\Mozilla Firefox\" -IconPath \"C:\\ProgramData\\ERPapp\\customicon.ico\" -Arguments \"https:\/\/www.google.com\" -User \"JohnSmith\"\r\n\r\n    Creating Shortcut at C:\\Users\\JohnSmith\\Desktop\\ERP App.lnk\r\n\r\n.PARAMETER NAME\r\n    The name of the shortcut, e.g., \"Login Portal\".\r\n\r\n.PARAMETER ExePath\r\n    The target field in the shortcut, excluding arguments.\r\n\r\n.PARAMETER Arguments\r\n    The arguments for the executable inside the shortcut.\r\n\r\n.PARAMETER StartIn\r\n    Some executables require that they be opened in a specific directory.\r\n\r\n.PARAMETER Icon\r\n    The path to an image file to use for the shortcut. You could also place the base64 string on line 79 and specify an IconDirectory with the below parameter.\r\n\r\n.PARAMETER IconDirectory\r\n    Path to store the .ico file to use for the shortcut.\r\n\r\n.PARAMETER IconURL\r\n    A link to an image file you would like to use for the shortcut. You could also place the base64 string on line 79 and specify an IconDirectory using '-IconDirectory'.\r\n\r\n.PARAMETER AllExistingUsers\r\n    Creates the shortcut for all existing users but not for new users, e.g., C:\\Users\\*\\Desktop\\shortcut.lnk.\r\n\r\n.PARAMETER AllUsers\r\n    Creates the shortcut in C:\\Users\\Public\\Desktop.\r\n\r\n.OUTPUTS\r\n    None\r\n.NOTES\r\n    Minimum OS Architecture Supported: Windows 7, Windows Server 2008\r\n    Release Notes: Split the script into three separate scripts, added script variable support, and improved icon 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    [String]$Name,\r\n    [Parameter()]\r\n    [String]$ExePath,\r\n    [Parameter()]\r\n    [String]$Arguments,\r\n    [Parameter()]\r\n    [String]$StartIn,\r\n    [Parameter()]\r\n    [String]$Icon,\r\n    [Parameter()]\r\n    [String]$IconDirectory,\r\n    [Parameter()]\r\n    [String]$IconUrl,\r\n    [Parameter()]\r\n    [Switch]$AllExistingUsers,\r\n    [Parameter()]\r\n    [String]$ExcludeUsers,\r\n    [Parameter()]\r\n    [Switch]$AllUsers\r\n)\r\n\r\nbegin {\r\n    Add-Type -AssemblyName System.Drawing\r\n\r\n    # If the line below is replaced with $IconBase64 = 'YourBase64EncodedImageInQuotes', the script will decode it and use it for the desktop shortcut. Be sure to provide an Icon Storage Directory.\r\n    $IconBase64 = $null\r\n\r\n    # Replace existing parameters with Form Variables if used.\r\n    if ($env:shortcutName -and $env:shortcutName -notlike \"null\") { $Name = $env:shortcutName }\r\n    if ($env:createTheShortcutFor -and $env:createTheShortcutFor -notlike \"null\") { \r\n        if ($env:createTheShortcutFor -eq \"All Users\") { $AllUsers = $True }\r\n        if ($env:createTheShortcutFor -eq \"All Existing Users\") { $AllExistingUsers = $True }\r\n    }\r\n    if ($env:exePath -and $env:exePath -notlike \"null\") { $ExePath = $env:exePath }\r\n    if ($env:exeArguments -and $env:exeArguments -notlike \"null\") { $Arguments = $env:exeArguments }\r\n    if ($env:exeShouldStartIn -and $env:exeShouldStartIn -notlike \"null\") { $StartIn = $env:exeShouldStartIn }\r\n    if ($env:linkToIconFile -and $env:linkToIconFile -notlike \"null\") { $IconUrl = $env:linkToIconFile }\r\n    if ($env:iconStorageDirectory -and $env:iconStorageDirectory -notlike \"null\") { $IconDirectory = $env:iconStorageDirectory }\r\n\r\n    # Ensure a user is specified for shortcut creation.\r\n    if (-not $AllUsers -and -not $AllExistingUsers -and -not $User) {\r\n        Write-Host \"[Error] You must specify which desktop to create the shortcut on!\"\r\n        exit 1\r\n    }\r\n\r\n    $invalidFileNames = '[&lt;&gt;:\"\/\\\\|?*\\x00-\\x1F]|\\.$|\\s$'\r\n    if ($Name -match $invalidFileNames) {\r\n        Write-Host '[Error] The name you specified contains one of the following invalid characters or ends with a period. &lt;&gt;:\"\/\\|?*'\r\n        exit 1\r\n    }\r\n\r\n    $ExitCode = 0\r\n    \r\n    # Icons are secondary. If no information is given, continue without them, but notify the technician.\r\n    if (($Icon -or $IconUrl) -and -not $IconDirectory) {\r\n        Write-Warning \"An icon was provided, but no storage location was specified. Use the Icon Storage Directory parameter to specify a directory to store it. (You may want this directory to be accessible by all users.)\"\r\n        Write-Warning \"Ignoring supplied icon info.\"\r\n        $ExitCode = 1\r\n        $Icon = $null\r\n        $IconUrl = $null\r\n    }\r\n\r\n    if ($Icon) {\r\n        $FileName = Split-Path $Icon -Leaf\r\n\r\n        # Check for valid icon formats. Only support .png, .jpg, .jpeg, .ico, and .gif.\r\n        if ($FileName -notmatch '\\.bmp$' -and $FileName -notmatch '\\.png$' -and $FileName -notmatch '\\.jpg$' -and $FileName -notmatch '\\.jpeg$' -and $FileName -notmatch '.ico$' -and $FileName -notmatch '.gif$') {\r\n            Write-Warning \"Your icon is in an invalid format. Only .png, .jpg, .jpeg, .ico, and .gif formats are supported. Switching to the default icon. You can re-run the script to replace the icon.\"\r\n            $Icon = $null\r\n        }\r\n\r\n        if (-not (Test-Path $Icon -ErrorAction SilentlyContinue)) {\r\n            Write-Warning \"It looks like your icon is missing. Skipping for now; re-run the script with a valid path to add the icon.\"\r\n            $Icon = $null\r\n        }\r\n    }\r\n\r\n    # Create the directory for the icon if it doesn't exist.\r\n    if ($IconDirectory -and -not (Test-Path $IconDirectory -ErrorAction SilentlyContinue)) {\r\n        New-Item -ItemType Directory -Path $IconDirectory | Out-Null\r\n    }\r\n\r\n    # For PowerShell 2.0 and 3.0 compatibility we're going to need to create a Get-FileHash function\r\n    if ($PSVersionTable.PSVersion.Major -lt 4) {\r\n        function Get-FileHash {\r\n            param (\r\n                [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]\r\n                [string[]]$Path,\r\n                [Parameter(Mandatory = $false)]\r\n                [ValidateSet(\"SHA1\", \"SHA256\", \"SHA384\", \"SHA512\", \"MD5\")]\r\n                [string]$Algorithm = \"SHA256\"\r\n            )\r\n            $Path | ForEach-Object {\r\n                # Only hash files that exist\r\n                $CurrentPath = $_\r\n                if ($(Test-Path -Path $CurrentPath -ErrorAction SilentlyContinue)) {\r\n                \r\n                    $HashAlgorithm = [System.Security.Cryptography.HashAlgorithm]::Create($Algorithm)\r\n                    $Hash = [System.BitConverter]::ToString($hashAlgorithm.ComputeHash([System.IO.File]::ReadAllBytes($CurrentPath)))\r\n                    @{\r\n                        Algorithm = $Algorithm\r\n                        Path      = $Path\r\n                        Hash      = $Hash.Replace('-', '')\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    # Convert a Base64 string to a file.\r\n    function ConvertFrom-Base64 {\r\n        param(\r\n            $Base64,\r\n            $Path\r\n        )\r\n        $bytes = [Convert]::FromBase64String($Base64)\r\n\r\n        [IO.File]::WriteAllBytes($Path, $bytes)\r\n    }\r\n\r\n    # Utility function for downloading files.\r\n    function Invoke-Download {\r\n        param(\r\n            [Parameter()]\r\n            [String]$URL,\r\n            [Parameter()]\r\n            [String]$BaseName,\r\n            [Parameter()]\r\n            [int]$Attempts = 3,\r\n            [Parameter()]\r\n            [Switch]$SkipSleep\r\n        )\r\n\r\n        # In case 'https:\/\/' is omitted from the URL.\r\n        if ($URL -notmatch \"^http(s)?:\/\/\") {\r\n            Write-Warning \"http(s):\/\/ is required to download the file. Adding https:\/\/ to your input....\"\r\n            $URL = \"https:\/\/$URL\"\r\n            Write-Warning \"New Url $URL.\"\r\n        }\r\n    \r\n        Write-Host \"Downloading using $URL\"\r\n\r\n        $SupportedTLSversions = [enum]::GetValues('Net.SecurityProtocolType')\r\n        if ( ($SupportedTLSversions -contains 'Tls13') -and ($SupportedTLSversions -contains 'Tls12') ) {\r\n            [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol::Tls13 -bor [System.Net.SecurityProtocolType]::Tls12\r\n        }\r\n        elseif ( $SupportedTLSversions -contains 'Tls12' ) {\r\n            [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12\r\n        }\r\n        else {\r\n            # Not everything requires TLS 1.2, but we'll try anyways.\r\n            Write-Warning \"TLS 1.2 and or TLS 1.3 isn't supported on this system. This download may fail!\"\r\n            if ($PSVersionTable.PSVersion.Major -lt 3) {\r\n                Write-Warning \"PowerShell 2 \/ .NET 2.0 doesn't support TLS 1.2.\"\r\n            }\r\n        }\r\n\r\n        $i = 1\r\n        While ($i -le $Attempts) {\r\n            # Some cloud services have rate-limiting\r\n            if (-not ($SkipSleep)) {\r\n                $SleepTime = Get-Random -Minimum 3 -Maximum 15\r\n                Write-Host \"Waiting for $SleepTime seconds.\"\r\n                Start-Sleep -Seconds $SleepTime\r\n            }\r\n            if ($i -ne 1) { Write-Host \"\" }\r\n            Write-Host \"Download Attempt $i\"\r\n\r\n            try {\r\n                # Invoke-WebRequest is preferred because it supports links that redirect, e.g., https:\/\/t.ly\r\n                if ($PSVersionTable.PSVersion.Major -lt 4) {\r\n                    # Figures out the type of file\r\n                    $WebClient = New-Object System.Net.WebClient\r\n                    $Response = $WebClient.OpenRead($Url)\r\n                    $MimeType = $WebClient.ResponseHeaders[\"Content-Type\"]\r\n                    $DesiredExtension = switch -regex ($MimeType) {\r\n                        \"image\/jpeg|image\/jpg\" { \"jpg\" }\r\n                        \"image\/png\" { \"png\" }\r\n                        \"image\/gif\" { \"gif\" }\r\n                        \"image\/bmp|image\/x-windows-bmp|image\/x-bmp\" { \"bmp\" }\r\n                        \"image\/x-icon|image\/vnd.microsoft.icon|application\/ico\" { \"ico\" }\r\n                        default { \r\n                            throw \"[Error] The URL you provided does not provide a supported image type. Image Types Supported: jpg, jpeg, ico, bmp, png and gif. Image Type detected: $MimeType\"\r\n                        }\r\n                    }\r\n                    # Downloads the file preserving the extension\r\n                    $Path = \"$BaseName.$DesiredExtension\"\r\n                    $WebClient.DownloadFile($URL, $Path)\r\n                }\r\n                else {\r\n                    # Standard options\r\n                    $WebRequestArgs = @{\r\n                        Uri                = $URL\r\n                        MaximumRedirection = 10\r\n                        UseBasicParsing    = $true\r\n                        Method             = \"GET\"\r\n                    }\r\n\r\n                    # Figures out the type of file\r\n                    $Response = Invoke-WebRequest @WebRequestArgs\r\n                    $MimeType = $Response.Headers.'Content-Type'\r\n                    $DesiredExtension = switch -regex ($MimeType) {\r\n                        \"image\/jpeg|image\/jpg\" { \"jpg\" }\r\n                        \"image\/png\" { \"png\" }\r\n                        \"image\/gif\" { \"gif\" }\r\n                        \"image\/bmp|image\/x-windows-bmp|image\/x-bmp\" { \"bmp\" }\r\n                        \"image\/x-icon|image\/vnd.microsoft.icon|application\/ico\" { \"ico\" }\r\n                        default { \r\n                            throw \"[Error] The URL you provided does not provide a supported image type. Image Types Supported: jpg, jpeg, ico, bmp, png and gif. Image Type detected: $MimeType\"\r\n                        }\r\n                    }\r\n                    # Define the path for saving the file\r\n                    $Path = \"$BaseName.$DesiredExtension\"\r\n\r\n                    # Save the content to the file\r\n                    $Response.Content | Set-Content -Path $Path -Encoding Byte\r\n                }\r\n\r\n                $File = Test-Path -Path $Path -ErrorAction SilentlyContinue\r\n            }\r\n            catch {\r\n                Write-Warning \"An error has occurred while downloading!\"\r\n                Write-Warning $_.Exception.Message\r\n                $_\r\n\r\n                if ($Path -and (Test-Path -Path $Path -ErrorAction SilentlyContinue)) {\r\n                    Remove-Item $Path -Force -Confirm:$false -ErrorAction SilentlyContinue\r\n                }\r\n\r\n                $File = $False\r\n            }\r\n\r\n            if ($File) {\r\n                $i = $Attempts\r\n            }\r\n            else {\r\n                Write-Warning \"File failed to download. Check the link\/URL and ensure it is correct, please note Ninja may have stripped out the following characters '&amp;|;$&gt;&lt;`!' from the link\/URL.\"\r\n                Write-Host \"\"\r\n            }\r\n\r\n            $i++\r\n        }\r\n\r\n        if ($Path -and -not (Test-Path $Path)) {\r\n            Write-Warning \"Failed to download file!\"\r\n        }\r\n        else {\r\n            return $Path\r\n        }\r\n    }\r\n\r\n    # Convert an image to an icon file. This method creates a png and then forms an ico file by appending the png's binary.\r\n    function ConvertFrom-Image {\r\n        param(\r\n            $ImagePath,\r\n            $Path\r\n        )\r\n\r\n        # Grab an instance of the image and blank bitmap\r\n        try {\r\n            $image = [Drawing.Image]::FromFile($ImagePath)\r\n        }\r\n        catch [System.OutOfMemoryException] {\r\n            Write-Host \"[Error] Loading Image file is either an unsupported file, or to large to process.\"\r\n            return\r\n        }\r\n        catch {\r\n            Write-Host \"[Error] $($_.Message)\"\r\n            return\r\n        }\r\n\r\n        # Resize the image to 255px by 255px while maintaining quality.\r\n        # If you want transparency, you'll need an Alpha channel in the pixel format.\r\n        $bitmap = New-Object System.Drawing.Bitmap (255, 255, [system.drawing.imaging.PixelFormat]::Format32bppArgb)\r\n        $bitmap.SetResolution(255, 255)\r\n\r\n        # Create a graphics object which will be used to resize the image to 255px by 255px\r\n        $graphics = [System.Drawing.Graphics]::FromImage($bitmap)\r\n\r\n        # Set some quality settings for the resize operation\r\n        $graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality\r\n        $graphics.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic\r\n        $graphics.PixelOffsetMode = [System.Drawing.Drawing2D.PixelOffsetMode]::HighQuality\r\n\r\n        # Draw the image onto the bitmap\r\n        $graphics.DrawImage($Image, 0, 0, 255, 255)\r\n        \r\n        # Temporarily save the image as a png\r\n        $RandomNumber = Get-Random -Maximum 1000000\r\n        $bitmap.Save(\"$env:TEMP\\image-$RandomNumber.png\", [System.Drawing.Imaging.ImageFormat]::Png)\r\n        $png = \"$env:TEMP\\image-$RandomNumber.png\"\r\n\r\n        # Build the ico file using the png binary.\r\n        if ($PSVersionTable.PSVersion.Major -gt 5) {\r\n            $pngBytes = Get-Content -Path $png -AsByteStream\r\n        }\r\n        elseif ($PSVersionTable.PSVersion.Major -gt 2) {\r\n            $pngBytes = Get-Content -Path $png -Encoding Byte -Raw\r\n        }\r\n        else {\r\n            $pngBytes = [System.IO.File]::ReadAllBytes($png)\r\n        }\r\n        $icoHeader = [byte[]] @(0, 0, 1, 0, 1, 0)\r\n        $imageDataSize = $pngBytes.Length\r\n        $icoDirectory = [byte[]] @(\r\n            255, 255, # icon size\r\n            0, 0, # color count\r\n            0, 0, # reserved\r\n            0, 0, # hotspot x, hotspot y\r\n            ($imageDataSize -band 0xFF),\r\n            ([Math]::Floor($imageDataSize \/ [Math]::Pow(2, 8)) -band 0xFF),\r\n            ([Math]::Floor($imageDataSize \/ [Math]::Pow(2, 16)) -band 0xFF),\r\n            ([Math]::Floor($imageDataSize \/ [Math]::Pow(2, 24)) -band 0xFF),\r\n            22, 0, 0, 0  # offset to image data\r\n        )\r\n        $iconData = $icoHeader + $icoDirectory + $pngBytes\r\n\r\n        # Save the completed icon file and clean up any temporary files.\r\n        if (Test-Path $Path -ErrorAction SilentlyContinue) { Remove-Item $Path -Force }\r\n        [System.IO.File]::WriteAllBytes($Path, $iconData)\r\n\r\n        if (Test-Path $png -ErrorAction SilentlyContinue) { Remove-Item $png -Force }\r\n        $bitmap.Dispose()\r\n        $image.Dispose()\r\n        $graphics.Dispose()\r\n        [System.GC]::Collect()\r\n\r\n        # Refresh the icon cache depending on the OS version.\r\n        if ([System.Environment]::OSVersion.Version.Major -ge 10) {\r\n            Invoke-Command { ie4uinit.exe -show }\r\n        }\r\n        else {\r\n            Invoke-Command { ie4uinit.exe -ClearIconCache }\r\n        }\r\n    }\r\n\r\n    # Verify if the script is being run with elevated privileges.\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    if (-not (Test-IsElevated)) {\r\n        Write-Host -Object \"[Error] Access Denied. Please run with Administrator privileges.\"\r\n        exit 1\r\n    }\r\n\r\n    # Retrieve all registry paths for actual users (excluding system or network service accounts).\r\n    function Get-UserHives {\r\n        param (\r\n            [Parameter()]\r\n            [ValidateSet('AzureAD', 'DomainAndLocal', 'All')]\r\n            [String]$Type = \"All\",\r\n            [Parameter()]\r\n            [String[]]$ExcludedUsers,\r\n            [Parameter()]\r\n            [switch]$IncludeDefault\r\n        )\r\n\r\n        # Different SID patterns for user account types: AzureAD, Domain, or Local.\r\n        $Patterns = switch ($Type) {\r\n            \"AzureAD\" { \"S-1-12-1-(\\d+-?){4}$\" }\r\n            \"DomainAndLocal\" { \"S-1-5-21-(\\d+-?){4}$\" }\r\n            \"All\" { \"S-1-12-1-(\\d+-?){4}$\" ; \"S-1-5-21-(\\d+-?){4}$\" } \r\n        }\r\n\r\n        # Extract user profiles that match the SID patterns. \r\n        $UserProfiles = Foreach ($Pattern in $Patterns) { \r\n            Get-ItemProperty \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\*\" |\r\n                Where-Object { $_.PSChildName -match $Pattern } | \r\n                Select-Object @{Name = \"SID\"; Expression = { $_.PSChildName } }, \r\n                @{Name = \"UserHive\"; Expression = { \"$($_.ProfileImagePath)\\NTuser.dat\" } }, \r\n                @{Name = \"UserName\"; Expression = { \"$($_.ProfileImagePath | Split-Path -Leaf)\" } },\r\n                @{Name = \"Path\"; Expression = { $_.ProfileImagePath } }\r\n        }\r\n\r\n        # Handle situations where information from the .Default user is required.\r\n        switch ($IncludeDefault) {\r\n            $True {\r\n                $DefaultProfile = \"\" | Select-Object UserName, SID, UserHive, Path\r\n                $DefaultProfile.UserName = \"Default\"\r\n                $DefaultProfile.SID = \"DefaultProfile\"\r\n                $DefaultProfile.Userhive = \"$env:SystemDrive\\Users\\Default\\NTUSER.DAT\"\r\n                $DefaultProfile.Path = \"C:\\Users\\Default\"\r\n\r\n                $DefaultProfile | Where-Object { $ExcludedUsers -notcontains $_.UserName }\r\n            }\r\n        }\r\n\r\n        $UserProfiles | Where-Object { $ExcludedUsers -notcontains $_.UserName }\r\n    }\r\n\r\n    # The actual shortcut creation\r\n    function New-Shortcut {\r\n        [CmdletBinding()]\r\n        param(\r\n            [Parameter()]\r\n            [String]$Arguments,\r\n            [Parameter()]\r\n            [String]$IconPath,\r\n            [Parameter(ValueFromPipeline = $True)]\r\n            [String]$Path,\r\n            [Parameter()]\r\n            [String]$Target,\r\n            [Parameter()]\r\n            [String]$WorkingDir\r\n        )\r\n        process {\r\n            Write-Host \"Creating Shortcut at $Path\"\r\n            $ShellObject = New-Object -ComObject (\"WScript.Shell\")\r\n            $Shortcut = $ShellObject.CreateShortcut($Path)\r\n            $Shortcut.TargetPath = $Target\r\n            if ($WorkingDir) { $Shortcut.WorkingDirectory = $WorkingDir }\r\n            if ($Arguments) { $ShortCut.Arguments = $Arguments }\r\n            if ($IconPath) { $Shortcut.IconLocation = $IconPath }\r\n            $Shortcut.Save()\r\n\r\n            if (-not (Test-Path $Path -ErrorAction SilentlyContinue)) {\r\n                Write-Host \"[Error] Unable to create Shortcut at $Path\"\r\n                exit 1\r\n            }\r\n        }\r\n    }\r\n}\r\nprocess {\r\n    $ShortcutPath = New-Object System.Collections.Generic.List[String]\r\n\r\n    # Creating the filename's for the path\r\n    if ($Url) { $File = \"$Name.url\"; $Target = $Url }\r\n    if ($ExePath) { $File = \"$Name.lnk\"; $Target = $ExePath }\r\n    if ($RDPTarget) { $File = \"$Name.rdp\" }\r\n\r\n    # Grabing the excluded users\r\n    if ($ExcludeUsers) { $ExcludedUsers = ($ExcludeUsers -split \",\").trim() }\r\n\r\n    # Building the path's and adding it to the ShortcutPath list\r\n    if ($AllUsers) { $ShortcutPath.Add(\"$env:Public\\Desktop\\$File\") }\r\n\r\n    if ($AllExistingUsers) {\r\n        $UserProfiles = Get-UserHives -ExcludedUsers $ExcludedUsers\r\n        # Loop through each user profile\r\n        $UserProfiles | ForEach-Object { $ShortcutPath.Add(\"$($_.Path)\\Desktop\\$File\") }\r\n    }\r\n\r\n    if ($User) { \r\n        $UserProfile = Get-UserHives | Where-Object { $_.Username -like $User }\r\n        $ShortcutPath.Add(\"$($UserProfile.Path)\\Desktop\\$File\")\r\n    }\r\n\r\n    $ShortcutArguments = @{\r\n        Target     = $Target\r\n        WorkingDir = $StartIn\r\n        Arguments  = $Arguments\r\n    }\r\n\r\n    # If we're given a url we'll want to download it\r\n    if ($IconUrl) {\r\n        $DownloadArguments = @{\r\n            URL      = $IconUrl\r\n            BaseName = \"$IconDirectory\\$Name\"\r\n        }\r\n        if ($SkipSleep) { $DownloadArguments[\"SkipSleep\"] = $True }\r\n\r\n        $Icon = Invoke-Download @DownloadArguments\r\n        if ($Icon -and -not (Test-Path $Icon -ErrorAction SilentlyContinue)) {\r\n            $ExitCode = 1\r\n            $Icon = $Null\r\n            $IconUrl = $Null\r\n        }\r\n    }\r\n\r\n    # This will convert the base64 into an image and save it to the temp folder\r\n    if ($IconBase64 -and $IconDirectory -and -not $Icon -and -not $IconUrl) {\r\n        Write-Verbose \"Converting Icon base64 to original image and saving to $IconDirectory...\"\r\n        ConvertFrom-Base64 -Base64 $IconBase64 -Path \"$IconDirectory\\$Name.Png\"\r\n        $Icon = \"$IconDirectory\\$Name.Png\"\r\n    }\r\n\r\n    if ($Icon -and (Get-Item -Path $Icon).Extension -notlike \".ico\") {\r\n        $FileHash = \"$((Get-FileHash -Path $Icon -Algorithm MD5).Hash)\"\r\n        Write-Verbose \"Converting image to icon and saving to $IconDirectory\\$FileHash.ico ...\"\r\n        ConvertFrom-Image -ImagePath $Icon -Path \"$IconDirectory\\$FileHash.ico\"\r\n        Remove-Item -Path $Icon -Force\r\n        $Icon = \"$IconDirectory\\$FileHash.ico\"\r\n    }\r\n    elseif ($Icon -and (Test-Path $Icon -ErrorAction SilentlyContinue)) {\r\n        $FileHash = \"$((Get-FileHash -Path $Icon -Algorithm MD5).Hash)\"\r\n        Move-Item -Path $Icon -Destination \"$IconDirectory\\$FileHash.ico\"\r\n        $Icon = \"$IconDirectory\\$FileHash.ico\"\r\n    }\r\n\r\n    if ($Icon -and (Test-Path $Icon -ErrorAction SilentlyContinue)) {\r\n        $ShortcutArguments[\"IconPath\"] = $Icon\r\n    }\r\n    elseif ($Icon) {\r\n        $ExitCode = 1\r\n    }\r\n\r\n    $ShortcutPath | New-Shortcut @ShortcutArguments\r\n\r\n    exit $ExitCode\r\n}end {\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>Detailansicht<\/h2>\n<h3>Skript-Synopse und Parameter<\/h3>\n<p>Die Hauptfunktion des PowerShell-Skripts besteht darin, Desktop-Verkn\u00fcpfungen f\u00fcr ausf\u00fchrbare Dateien mit bestimmten Optionen zu erstellen. Es unterst\u00fctzt die Erstellung von Verkn\u00fcpfungen f\u00fcr alle Benutzer:innen, einschlie\u00dflich neuer Anwender:innen, oder nur f\u00fcr bestehende. Hier finden Sie eine \u00dcbersicht \u00fcber die Parameter und Funktionen:<\/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=\"1\" data-aria-level=\"1\"><strong>Name<\/strong>: Der Name der Verkn\u00fcpfung, zum Beispiel &#8218;Login Portal&#8216;.<\/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=\"2\" data-aria-level=\"1\"><strong>ExePath<\/strong>: Der Pfad zur ausf\u00fchrbaren Datei.<\/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=\"3\" data-aria-level=\"1\"><strong>Arguments<\/strong>: Alle Argumente, die an die ausf\u00fchrbare Datei \u00fcbergeben werden.<\/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>StartIn<\/strong>: Das Verzeichnis, in dem die ausf\u00fchrbare Datei gestartet werden soll.<\/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>Icon<\/strong>: Pfad zu einer Bilddatei f\u00fcr das Verkn\u00fcpfungssymbol.<\/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=\"6\" data-aria-level=\"1\"><strong>IconDirectory<\/strong>: Verzeichnis zum Speichern der Symboldatei.<\/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=\"7\" data-aria-level=\"1\"><strong>IconURL<\/strong>: URL zu einer Bilddatei f\u00fcr das Verkn\u00fcpfungssymbol.<\/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=\"8\" data-aria-level=\"1\"><strong>AllExistingUsers<\/strong>: Erzeugt die Verkn\u00fcpfung f\u00fcr alle vorhandenen Benutzer:innen.<\/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=\"9\" data-aria-level=\"1\"><strong>AllUsers<\/strong>: Erstellt die Verkn\u00fcpfung f\u00fcr alle Anwender:innen, auch f\u00fcr neue.<\/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=\"10\" data-aria-level=\"1\"><strong>ExcludeUsers<\/strong>: Liste der Benutzer:innen, die von der Erstellung von Verkn\u00fcpfungen ausgeschlossen werden sollen.<\/li>\n<\/ul>\n<h2>Skript-Funktionalit\u00e4t<\/h2>\n<h3><em>Ersteinrichtung<\/em><\/h3>\n<p>Das Skript beginnt mit dem Hinzuf\u00fcgen der erforderlichen .NET-Assembly zum Zeichnen, die f\u00fcr die Handhabung von Bilddateien entscheidend ist. Es enth\u00e4lt auch einen Abschnitt f\u00fcr den Umgang mit base64-kodierten Symbolen, was Flexibilit\u00e4t f\u00fcr die dynamische Symbolerstellung bietet.<\/p>\n<h3><em>Handhabung der Parameter<\/em><\/h3>\n<p>Umgebungsvariablen k\u00f6nnen die angegebenen Parameter \u00fcberschreiben, sodass sich das Skript an unterschiedliche Laufzeitbedingungen anpassen kann. Dies ist besonders in automatisierten Bereitstellungsszenarien n\u00fctzlich.<\/p>\n<h3><em>Benutzer-Validierung<\/em><\/h3>\n<p>Bevor das Skript fortf\u00e4hrt, pr\u00fcft es, ob ein Benutzer f\u00fcr die Erstellung der Verkn\u00fcpfung angegeben wurde. Dadurch werden Fehler vermieden und sichergestellt, dass das Skript auf die richtigen Benutzerprofile abzielt.<\/p>\n<h3><em>Verarbeitung von Symbolen<\/em><\/h3>\n<p>Das Skript enth\u00e4lt eine robuste Verarbeitung von Symbolen:<\/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=\"11\" data-aria-level=\"1\">es pr\u00fcft auf g\u00fcltige Dateiformate,<\/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=\"12\" data-aria-level=\"1\">l\u00e4dt Symbole von URLs herunter, falls angegeben,<\/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=\"13\" data-aria-level=\"1\">konvertiert base64-kodierte Bilder in Symbol-Dateien und<\/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=\"14\" data-aria-level=\"1\">konvertiert bei Bedarf verschiedene Bildformate in .ico-Dateien.<\/li>\n<\/ul>\n<h3><em>Erstellung von Verkn\u00fcpfungen<\/em><\/h3>\n<p>Mit Hilfe des COM-Objekts WScript.Shell erstellt das Skript Verkn\u00fcpfungen mit den angegebenen Parametern. Es unterst\u00fctzt mehrere Benutzerprofile, indem es durch Benutzerverzeichnisse iteriert.<\/p>\n<h2>Potenzielle Anwendungsf\u00e4lle<\/h2>\n<h3><em>Praxisnahes Szenario<\/em><\/h3>\n<p>Stellen Sie sich eine IT-Abteilung in einem gro\u00dfen Unternehmen vor, die ein neues Unternehmensressourcenplanung (ERP)-System einf\u00fchren muss. Das IT-Team kann dieses Skript verwenden, um eine Desktop-Verkn\u00fcpfung f\u00fcr die ERP-Anwendung auf den Desktops aller Benutzer:innen zu erstellen. Durch die Angabe des ausf\u00fchrbaren Pfads, des Startverzeichnisses und des benutzerdefinierten Symbols gew\u00e4hrleistet das Team eine einheitliche und professionelle Benutzererfahrung. Die F\u00e4higkeit des Skripts, mehrere Benutzerprofile zu verwalten, vereinfacht die Bereitstellung im gesamten Unternehmen.<\/p>\n<h2>Vergleiche<\/h2>\n<p>Die manuelle Erstellung von Desktop-Verkn\u00fcpfungen oder \u00fcber Gruppenrichtlinien kann im Vergleich zur Verwendung eines PowerShell-Skripts umst\u00e4ndlich und weniger flexibel sein. Gruppenrichtlinien bieten ein gewisses Ma\u00df an Automatisierung, aber nicht die detaillierte Kontrolle und Anpassung, die dieses Skript bietet. Au\u00dferdem kann das Skript dynamische Szenarien wie das Herunterladen von Symbolen von URLs oder die Konvertierung von base64-kodierten Bildern handhaben, was mit herk\u00f6mmlichen Methoden nicht m\u00f6glich ist.<\/p>\n<h2>FAQs<\/h2>\n<ol>\n<li><strong> Kann dieses Skript auf allen Versionen von Windows ausgef\u00fchrt werden?<\/strong> Das Skript unterst\u00fctzt Windows 7 und neuere Versionen, einschlie\u00dflich Windows Server 2008 und h\u00f6her.<\/li>\n<li><strong> Was passiert, wenn die Symboldatei nicht g\u00fcltig ist?<\/strong> Das Skript erstellt die Verkn\u00fcpfung standardm\u00e4\u00dfig ohne ein Symbol, wenn die angegebene Symboldatei ung\u00fcltig ist.<\/li>\n<li><strong> Wie geht das Skript mit Berechtigungen um?<\/strong> Das Skript pr\u00fcft, ob es \u00fcber erh\u00f6hte Rechte verf\u00fcgt, um sicherzustellen, dass es die erforderlichen Berechtigungen zur Erstellung von Desktop-Verkn\u00fcpfungen \u00fcber mehrere Benutzerprofile hinweg besitzt.<\/li>\n<li><strong> Kann das Skript so ver\u00e4ndert werden, dass es zus\u00e4tzliche Parameter unterst\u00fctzt?<\/strong> Ja, das Skript ist modular aufgebaut und kann leicht erweitert werden, um zus\u00e4tzliche Parameter oder Funktionen zu unterst\u00fctzen.<\/li>\n<\/ol>\n<h2>Folgen<\/h2>\n<p>Die Automatisierung der Erstellung von Desktop-Verkn\u00fcpfungen mit diesem PowerShell-Skript kann den IT-Betrieb erheblich rationalisieren, da der manuelle Aufwand reduziert und <a href=\"https:\/\/www.ninjaone.com\/de\/blog\/wie-menschliches-versagen-mit-cybersecurity-risiken-zusammenhaengt\/\" target=\"_blank\" rel=\"noopener\">das Risiko menschlichen Versagens minimiert<\/a> wird. Es ist jedoch essenziell, daf\u00fcr zu sorgen, dass das Skript mit den entsprechenden Berechtigungen ausgef\u00fchrt wird, um Sicherheitsprobleme zu vermeiden. Die ordnungsgem\u00e4\u00dfe Verwaltung und Bereitstellung von Verkn\u00fcpfungen tr\u00e4gt auch dazu bei, eine saubere und organisierte Desktop-Umgebung f\u00fcr Benutzer:innen zu erhalten.<\/p>\n<h2>Empfehlungen<\/h2>\n<p>Wenn Sie dieses Skript verwenden:<\/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=\"15\" data-aria-level=\"1\">Testen Sie es immer in einer Staging-Umgebung, bevor Sie die Software an alle Anwender:innen verteilen.<\/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=\"16\" data-aria-level=\"1\">Stellen Sie sicher, dass das Symbolverzeichnis f\u00fcr alle Benutzer:innen zug\u00e4nglich ist.<\/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=\"17\" data-aria-level=\"1\">Aktualisieren Sie das Skript regelm\u00e4\u00dfig, um neue Benutzerprofile und ver\u00e4nderte Anforderungen zu ber\u00fccksichtigen.<\/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=\"18\" data-aria-level=\"1\">F\u00fchren Sie eine klare Dokumentation f\u00fcr alle am Skript vorgenommenen \u00c4nderungen.<\/li>\n<\/ul>\n<h2>Abschlie\u00dfende \u00dcberlegungen<\/h2>\n<p>PowerShell-Skripte wie dieses sind leistungsstarke Tools, die IT-Experten Automatisierungs- und Anpassungsm\u00f6glichkeiten zur Optimierung von Routineaufgaben bieten. F\u00fcr IT-Abteilungen und MSPs kann der Einsatz solcher Skripte zu einem effizienteren Betrieb und einer besseren Erfahrung f\u00fcr die Endbenutzer:innen f\u00fchren.<\/p>\n<p>NinjaOne, eine umfassende IT-Management-Plattform, kann solche Skripte in seine Automatisierungs-Workflows integrieren und bietet damit eine nahtlose und leistungsstarke L\u00f6sung f\u00fcr die Verwaltung von skalierten IT-Umgebungen. Durch das Verst\u00e4ndnis und die Verwendung dieses PowerShell-Skripts k\u00f6nnen IT-Experten ihr Toolkit erweitern und eine <a href=\"https:\/\/www.ninjaone.com\/de\/effizienz\/\" target=\"_blank\" rel=\"noopener\">effiziente<\/a> und effektive Verwaltung von Desktop-Umgebungen sicherstellen.<\/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":[4307],"class_list":["post-388753","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\/388753","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=388753"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/media?parent=388753"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/operating_system?post=388753"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/use_cases?post=388753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}