{"id":458025,"date":"2025-04-28T12:24:56","date_gmt":"2025-04-28T12:24:56","guid":{"rendered":"https:\/\/www.ninjaone.com\/?post_type=script_hub&#038;p=458025"},"modified":"2025-04-28T12:24:56","modified_gmt":"2025-04-28T12:24:56","slug":"automatisierung-der-erstellung-von-remote-desktop-verknuepfungen","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/de\/script-hub\/automatisierung-der-erstellung-von-remote-desktop-verknuepfungen\/","title":{"rendered":"Automatisierung der Erstellung von Remote-Desktop-Verkn\u00fcpfungen mit PowerShell"},"content":{"rendered":"<h2>Wichtigste Erkenntnisse<\/h2>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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 Verkn\u00fcpfungen<\/strong>: Dieses PowerShell-Skript automatisiert die Erstellung von RDP-Verkn\u00fcpfungen, spart Zeit und reduziert manuelle Fehler.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Anpassbare Optionen<\/strong>: Es bietet umfangreiche Anpassungsm\u00f6glichkeiten, einschlie\u00dflich bez\u00fcglich der Anzeigeeinstellungen, Benutzeranmeldeinformationen und Gateway-Konfigurationen.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Skalierbarkeit f\u00fcr gro\u00dfe Umgebungen<\/strong>: Ideal f\u00fcr MSPs und IT-Abteilungen, die mehrere Remote-Verbindungen verwalten.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Erfordern von Administratorrechten<\/strong>: Erfordert f\u00fcr bestimmte Vorg\u00e4nge Administratorrechte, um die Sicherheit zu gew\u00e4hrleisten.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Konfliktmanagement<\/strong>: Enth\u00e4lt Pr\u00fcfungen auf widerspr\u00fcchliche Optionen, die Benutzer:innen zur optimalen Konfiguration f\u00fchren.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Sicherheitsbewusst<\/strong>: Priorisiert die sichere Handhabung von Anmeldeinformationen und Bereitstellung von Verkn\u00fcpfungen.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Gesteigerte Produktivit\u00e4t<\/strong>: Optimiert den Prozess der Remote-Desktop-Verwaltung und steigert dadurch die IT-Produktivit\u00e4t insgesamt.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Erg\u00e4nzende Tools<\/strong>: Kann effektiv mit Verwaltungsplattformen wie NinjaOne f\u00fcr umfassende IT-L\u00f6sungen kombiniert werden.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.ninjaone.com\/blog\/what-is-remote-desktop-protocol-rdp\/\">RDP-Verkn\u00fcpfungen (Remote Desktop Protocol)<\/a> sind wichtige Tools in der IT-Welt, die eine nahtlose Verbindung zu Remote-Systemen erm\u00f6glichen. Mit der Entwicklung vernetzter Umgebungen und dem wachsenden Bedarf an effizientem Fernzugriff wird die M\u00f6glichkeit, diese Verkn\u00fcpfungen schnell zu erstellen und zu verwalten, unerl\u00e4sslich. Dieses in PowerShell erstellte Skript bietet einen optimierten, anpassbaren Ansatz zur Erstellung von RDP-Verkn\u00fcpfungen und steigert die Produktivit\u00e4t von IT-Experten und <a href=\"https:\/\/www.ninjaone.com\/de\/was-ist-ein-msp\/\">Managed Service Providern (MSPs)<\/a>.<\/p>\n<h2>Hintergrund und Bedeutung des PowerShell-Skripts<\/h2>\n<p>Bisher war die Erstellung und Verwaltung von RDP-Verkn\u00fcpfungen mit manuellen Prozessen verbunden, was insbesondere in gro\u00dfen oder dynamischen IT-Umgebungen zeitaufw\u00e4ndig und fehleranf\u00e4llig sein kann. Dieses PowerShell-Skript l\u00f6st diese Herausforderung, indem es die Erstellung von Remote-Desktop-Verkn\u00fcpfungen mit benutzerdefinierten Parametern automatisiert. Eine solche Automatisierung ist besonders f\u00fcr IT-Teams von Vorteil, die mehrere Remote-Verbindungen verwalten, sowie f\u00fcr Systemh\u00e4user, die ihren Kunden schnell Fernzugriffsl\u00f6sungen bereitstellen m\u00fcssen.<\/p>\n<h2>Das Skript zur Automatisierung der Erstellung von Remote-Desktop-Verkn\u00fcpfungen<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">&lt;#\r\n.SYNOPSIS\r\n    This script will create an rdp desktop shortcut with your specified options. It can create a shortcut for all users (including new ones) or existing ones only.\r\n.DESCRIPTION\r\n    This script will create an rdp desktop shortcut with your specified options. \r\n    It can create a shortcut for all users (including new ones) or existing ones only.\r\n.EXAMPLE\r\n    To Create a windowed RDP Shortcut simply specify the size, the name of the shortcut and which users the shortcut is for. You can also specify \"MultiMon\" for multi-monitor support. Or a gateway to use.\r\n    \r\n    PS C:&gt; .\/Create-DesktopShortcut.ps1 -Name \"Test\" -RDPTarget \"SRV19-TEST\" -RDPUser \"TESTjsmith\" -Width \"1920\" -Height \"1080\" -AllExistingUsers -ExcludeUsers \"ChrisWashington,JohnLocke\"\r\n    \r\n    Creating Shortcut at C:UsersJohnSmithDesktopTest.rdp\r\n\r\n.PARAMETER NAME\r\n    Name of the shortcut ex. \"Login Portal\".\r\n\r\n.PARAMETER RDPtarget\r\n    IP Address or DNS Name and port to the RDS Host ex. \"TEST-RDSH:28665\".\r\n\r\n.PARAMETER RDPuser\r\n    Username to autofill in username field.\r\n\r\n.PARAMETER AlwaysPrompt \r\n    Always Prompt for credentials.\r\n\r\n.PARAMETER Gateway\r\n    IP Address or DNS Name and port of the RD Gateway ex. \"TESTrdp.example.com:4433\".\r\n\r\n.PARAMETER SeperateGateWayCreds\r\n    If the RDS Gateway uses different creds than the Session Host use this parameter.\r\n\r\n.PARAMETER FullScreen\r\n    RDP Shortcut should open window in 'FullScreen' mode.\r\n\r\n.PARAMETER MultiMon\r\n    RDP Shortcut should open window with Multi-Monitor Support enabled.\r\n\r\n.PARAMETER Width\r\n    Width of RDP Window should open ex. \"1920\".\r\n\r\n.PARAMETER Height\r\n    Height of RDP Window shortcut should open ex. \"1080\".\r\n\r\n.PARAMETER AllExistingUsers\r\n    Create the Shortcut for all existing users but not new users ex. C:Users*Desktopshortcut.lnk.\r\n\r\n.PARAMETER ExcludeUsers\r\n    Comma seperated list of users to exclude from shortcut placement.\r\n\r\n.PARAMETER AllUsers\r\n    Create the Shortcut in C:UsersPublicDesktop.\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: Renamed script, Split script into three, added Script Variable support, fixed bugs in RDP Shortcut\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]$RDPtarget,\r\n    [Parameter()]\r\n    [String]$RDPuser,\r\n    [Parameter()]\r\n    [Switch]$AlwaysPrompt = [System.Convert]::ToBoolean($env:alwaysPromptForRdpCredentials),\r\n    [Parameter()]\r\n    [String]$Gateway,\r\n    [Parameter()]\r\n    [Switch]$SeparateGateWayCreds = [System.Convert]::ToBoolean($env:separateRdpGatewayCredentials),\r\n    [Parameter()]\r\n    [Switch]$FullScreen,\r\n    [Parameter()]\r\n    [Switch]$MultiMon,\r\n    [Parameter()]\r\n    [Int]$Width,\r\n    [Parameter()]\r\n    [Int]$Height,\r\n    [Parameter()]\r\n    [Switch]$AllExistingUsers,\r\n    [Parameter()]\r\n    [Switch]$AllUsers\r\n)\r\n\r\nbegin {\r\n\r\n    # Replace existing params with form variables if they're 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:rdpServerAddress -and $env:rdpServerAddress -notlike \"null\") { $RDPtarget = $env:rdpServerAddress }\r\n    if ($env:rdpUsername -and $env:rdpUsername -notlike \"null\") { $RDPuser = $env:rdpUsername }\r\n    if ($env:rdpGatewayServerAddress -and $env:rdpGatewayServerAddress -notlike \"null\") { $Gateway = $env:rdpGatewayServerAddress }\r\n    if ($env:rdpWindowSize -and $env:rdpWindowSize -notlike \"null\") {\r\n        if ($env:rdpWindowSize -eq \"Fullscreen Multiple Monitor Mode\") { $MultiMon = $True }\r\n        if ($env:rdpWindowSize -eq \"Fullscreen\") { $FullScreen = $True }\r\n    }\r\n    if ($env:customRdpWindowWidth -and $env:customRdpWindowWidth -notlike \"null\") { $Width = $env:customRdpWindowWidth }\r\n    if ($env:customRdpWindowHeight -and $env:customRdpWindowHeight -notlike \"null\") { $Height = $env:customRdpWindowHeight }\r\n\r\n    # Output warnings for conflicting options.\r\n    if (($Width -and -not $Height ) -or ($Height -and -not $Width)) {\r\n        Write-Warning \"You forgot to include both the width and height. RDP Window will be in fullscreen mode.\"\r\n    }\r\n\r\n    if (($Width -or $Height) -and ($FullScreen -or $MultiMon)) {\r\n        if ($MultiMon) {\r\n            Write-Warning \"Conflicting Display Option selected. Using Fullscreen Multi-monitor.\"\r\n        }\r\n        else {\r\n            Write-Warning \"Conflicting Display Option selected. Using Fullscreen.\"\r\n        }\r\n    }\r\n\r\n    # Double-check that a user is specified for shortcut creation.\r\n    if (-not $AllUsers -and -not $AllExistingUsers -and -not $User) {\r\n        Write-Error \"You must specify which desktop to create the shortcut on!\"\r\n        exit 1\r\n    }\r\n\r\n    # Double-check that a shortcut name was provided.\r\n    if (-not $Name -or -not $RDPtarget) {\r\n        Write-Error \"You must specify a name and target for the shortcut!\"\r\n        exit 1\r\n    }\r\n\r\n    # Creating a shortcut at C:UsersPublicDesktop requires admin rights.\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 (!(Test-IsElevated)) {\r\n        Write-Error -Message \"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        # User account SIDs follow a particular pattern depending on whether they're Azure AD, Domain, or local \"workgroup\" accounts.\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        # We'll need the NTuser.dat file to load each users registry hive. So we grab it if their account sid matches the above pattern. \r\n        $UserProfiles = Foreach ($Pattern in $Patterns) { \r\n            Get-ItemProperty \"HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionProfileList*\" |\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        # In some cases, it's necessary to retrieve the .Default user's information.\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:SystemDriveUsersDefaultNTUSER.DAT\"\r\n                $DefaultProfile.Path = \"C:UsersDefault\"\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\nprocess {\r\n    $ShortcutPath = New-Object System.Collections.Generic.List[String]\r\n\r\n    # Create the filenames for the path.\r\n    if ($RDPTarget) { $File = \"$Name.rdp\" }\r\n\r\n    # Build the paths and add them to the ShortcutPath list.\r\n    if ($AllUsers) { $ShortcutPath.Add(\"$env:PublicDesktop$File\") }\r\n\r\n    if ($AllExistingUsers) {\r\n        $UserProfiles = Get-UserHives\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    $RDPFile = New-Object System.Collections.Generic.List[String]\r\n\r\n    # Base template of an .RDP file. Additional options will be appended based on user selection.\r\n    $Template = @\"\r\nsession bpp:i:32\r\ncompression:i:1\r\nkeyboardhook:i:2\r\naudiocapturemode:i:0\r\nvideoplaybackmode:i:1\r\nconnection type:i:7\r\nnetworkautodetect:i:1\r\nbandwidthautodetect:i:1\r\ndisplayconnectionbar:i:1\r\nenableworkspacereconnect:i:0\r\ndisable wallpaper:i:0\r\nallow font smoothing:i:0\r\nallow desktop composition:i:0\r\ndisable full window drag:i:1\r\ndisable menu anims:i:1\r\ndisable themes:i:0\r\ndisable cursor setting:i:0\r\nbitmapcachepersistenable:i:1\r\naudiomode:i:0\r\nredirectprinters:i:1\r\nredirectcomports:i:0\r\nredirectsmartcards:i:1\r\nredirectwebauthn:i:1\r\nredirectclipboard:i:1\r\nredirectposdevices:i:0\r\nautoreconnection enabled:i:1\r\nauthentication level:i:2\r\nnegotiate security layer:i:1\r\nremoteapplicationmode:i:0\r\nalternate shell:s:\r\nshell working directory:s:\r\ngatewaycredentialssource:i:4\r\ngatewaybrokeringtype:i:0\r\nuse redirection server name:i:0\r\nrdgiskdcproxy:i:0\r\nkdcproxyname:s:\r\nenablerdsaadauth:i:0\r\n\"@\r\n    $RDPFile.Add($Template)\r\n\r\n    # This will generate the actual .rdp file\r\n    $ShortcutPath | ForEach-Object {\r\n        $RDPFile.Add(\"full address:s:$RDPTarget\")\r\n        $RDPFile.Add(\"gatewayhostname:s:$Gateway\")\r\n\r\n        if ($Width) { $RDPFile.Add(\"desktopwidth:i:$Width\") }\r\n        if ($Height) { $RDPFile.Add(\"desktopheight:i:$Height\") }\r\n        if ($MultiMon) { $RDPFile.Add(\"use multimon:i:1\") }else { $RDPFile.Add(\"use multimon:i:0\") }\r\n        if ($FullScreen -or $MultiMon -or !$Height -or !$Width) { $RDPFile.Add(\"screen mode id:i:2\") }else { $RDPFile.Add(\"screen mode id:i:1\") }\r\n        if ($AlwaysPrompt) { $RDPFile.Add(\"prompt for credentials:i:1\") }else { $RDPFile.Add(\"prompt for credentials:i:0\") }\r\n        if ($Gateway) { $RDPFile.Add(\"gatewayusagemethod:i:2\") }else { $RDPFile.Add(\"gatewayusagemethod:i:4\") }\r\n        if ($SeparateGateWayCreds) { \r\n            $RDPFile.Add(\"promptcredentialonce:i:0\")\r\n            $RDPFile.Add(\"gatewayprofileusagemethod:i:1\")  \r\n        }\r\n        else { \r\n            $RDPFile.Add(\"promptcredentialonce:i:1\") \r\n            if ($Gateway) { $RDPFile.Add(\"gatewayprofileusagemethod:i:0\") }\r\n        }\r\n            \r\n        if ($RDPUser) { $RDPFile.Add(\"username:s:$RDPUser\") }\r\n\r\n        Write-Host \"Creating Shortcut at $_\"\r\n        $RDPFile | Out-File $_\r\n\r\n        if (!(Test-Path $_ -ErrorAction SilentlyContinue)) {\r\n            Write-Error \"Unable to create Shortcut at $_\"\r\n            exit 1\r\n        }\r\n    }\r\n\r\n    exit 0\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>Erkl\u00e4rung des Skripts: Eine schrittweise Aufschl\u00fcsselung<\/h2>\n<p>Das Skript beginnt mit einer Zusammenfassung und einer Beschreibung, die einen klaren \u00dcberblick \u00fcber die Funktionalit\u00e4t des Skripts geben. Anschlie\u00dfend werden Parameter festgelegt, einschlie\u00dflich des Namens der Verkn\u00fcpfung, des RDP-Zielservers, der Anmeldeinformationen vom Benutzer, der Anzeigeoptionen, (Vollbild oder Unterst\u00fctzung mehrerer Monitore), und der M\u00f6glichkeit, Verkn\u00fcpfungen f\u00fcr alle oder bestimmte Benutzer:innen zu erstellen.<\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Definition der Parameter<\/strong>: Das Skript definiert verschiedene Parameter, mit denen die RDP-Verkn\u00fcpfung angepasst werden kann. Dazu geh\u00f6ren grundlegende Details wie der Name der Verkn\u00fcpfung, das RDP-Ziel und der Benutzer sowie erweiterte Optionen wie die Fenstergr\u00f6\u00dfe, die Unterst\u00fctzung mehrerer Monitore und die Gateway-Konfiguration.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Umgebungsvariablen und Konfliktpr\u00fcfung<\/strong>: Das Skript \u00fcberpr\u00fcft die Parameter und ersetzt sie durch Umgebungsvariablen, falls vorhanden. Es gibt auch Warnmeldungen aus, wenn sich die Optionen widersprechen, zum Beispiel wenn sowohl Vollbild als auch Fenstergr\u00f6\u00dfe angegeben werden.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Handhabung von Administratorrechten und Benutzerprofilen<\/strong>: Das Skript enth\u00e4lt eine Funktion zur \u00dcberpr\u00fcfung der Administratorrechte, die f\u00fcr die Erstellung von Verkn\u00fcpfungen in bestimmten Verzeichnispfaden erforderlich sind. Es enth\u00e4lt auch eine Funktion zum Abrufen von Benutzerprofilen, mit Ausnahme von Systemkonten, was f\u00fcr die Bereitstellung von Verkn\u00fcpfungen zu bestimmten Benutzer-Desktops entscheidend ist.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Prozess der Erstellung von Verkn\u00fcpfungen<\/strong>: Das Skript generiert die .RDP-Datei, indem es die vom Benutzer ausgew\u00e4hlten Optionen an eine Basisvorlage anh\u00e4ngt. Anschlie\u00dfend werden die ermittelten Verkn\u00fcpfungspfade durchlaufen und die RDP-Datei an jedem Ort erstellt.<\/li>\n<\/ul>\n<h2>Potenzielle Anwendungsf\u00e4lle: Eine Anwendung aus der Praxis<\/h2>\n<p>Stellen Sie sich einen MSP vor, der f\u00fcr die Verwaltung des Fernzugriffs f\u00fcr ein Unternehmen mit mehreren Abteilungen verantwortlich ist, die jeweils spezifische RDP-Konfigurationen ben\u00f6tigen. Mit diesem Skript kann der MSP schnell angepasste RDP-Verkn\u00fcpfungen f\u00fcr jede Abteilung generieren und diese effizient auf den jeweiligen Benutzer-Desktops bereitstellen, wodurch die manuelle Einrichtungszeit erheblich reduziert wird.<\/p>\n<h2>Vergleichende Analyse: Skript vs. traditionelle Methoden<\/h2>\n<p>Im Vergleich zur manuellen Erstellung von RDP-Verkn\u00fcpfungen bietet dieses Skript erhebliche Vorteile in Bezug auf Skalierbarkeit, Anpassbarkeit und Fehlerreduzierung. W\u00e4hrend manuelle Methoden f\u00fcr einzelne Setups ausreichen m\u00f6gen, werden sie in gr\u00f6\u00dferen, dynamischeren Umgebungen unpraktisch, wo dieses Skript m\u00fchelos komplexe Konfigurationen verwalten kann.<\/p>\n<h2>H\u00e4ufig gestellte Fragen<\/h2>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Kann das Skript unterschiedliche Anmeldeinformationen f\u00fcr RDP und Gateway verarbeiten?<\/strong><br \/>\nJa, es enth\u00e4lt einen Parameter f\u00fcr separate Gateway-Anmeldeinformationen.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Ist es m\u00f6glich, bestimmte Benutzer:innen auszuschlie\u00dfen?<\/strong><br \/>\nDas Skript erm\u00f6glicht den Ausschluss bestimmter Benutzer:innen vom Erhalt der Verkn\u00fcpfung.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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 gew\u00e4hrleistet das Skript die Sicherheit?<\/strong><br \/>\nEs erfordert Administratorrechte und verwaltet sorgf\u00e4ltig die Anmeldeinformationen von Benutzer:innen.<\/li>\n<\/ul>\n<h2>Auswirkungen und Sicherheits\u00fcberlegungen<\/h2>\n<p>Obwohl dieses Skript die Erstellung von Remote-Desktop-Verkn\u00fcpfungen erheblich vereinfacht, m\u00fcssen die Auswirkungen auf die Sicherheit ber\u00fccksichtigt werden. Der ordnungsgem\u00e4\u00dfe Umgang mit Anmeldeinformationen und die Sicherstellung, dass Verkn\u00fcpfungen nur f\u00fcr autorisierte Benutzer:innen bereitgestellt werden, sind entscheidende Aspekte. Dar\u00fcber hinaus sollten MSPs die Konfigurationen von Verkn\u00fcpfungen regelm\u00e4\u00dfig \u00fcberpr\u00fcfen, um die Sicherheitsstandards aufrechtzuerhalten.<\/p>\n<h2>Best Practices f\u00fcr die Verwendung des Skripts<\/h2>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Gr\u00fcndliche Pr\u00fcfung<\/strong>: Testen Sie das Skript vor dem weit verbreiteten Einsatz gr\u00fcndlich in einer kontrollierten Umgebung.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Regelm\u00e4\u00dfige Updates<\/strong>: Halten Sie das Skript bei \u00c4nderungen der Netzinfrastruktur auf dem neuesten Stand.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&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>Sicherheitskontrollen<\/strong>: \u00dcberpr\u00fcfen Sie regelm\u00e4\u00dfig den Einsatz von Verkn\u00fcpfungen auf Sicherheitsschwachstellen.<\/li>\n<\/ul>\n<h2>Schlussfolgerung: Verbessertes Remote-Desktop-Management mit NinjaOne<\/h2>\n<p>Zusammenfassend l\u00e4sst sich sagen, dass dieses PowerShell-Skript ein leistungsstarkes Tool zum Erstellen und Verwalten von RDP-Verkn\u00fcpfungen ist, das Anpassungen und Effizienz bietet. Tools wie NinjaOne erg\u00e4nzen solche Skripte, indem sie eine <a href=\"https:\/\/www.ninjaone.com\/de\/\">einheitliche Plattform f\u00fcr die Verwaltung vom IT-Betrieb<\/a>, einschlie\u00dflich Remote-Desktop-Verbindungen, bereitstellen und dadurch IT-Verwaltungsaufgaben rationalisieren und die allgemeine Produktivit\u00e4t sowie Sicherheit in Remote-Arbeitsszenarien verbessern.<\/p>\n","protected":false},"author":35,"featured_media":193911,"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-458025","script_hub","type-script_hub","status-publish","has-post-thumbnail","hentry","script_hub_category-windows","use_cases-allgemeine-konfiguration"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/script_hub\/458025","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=458025"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/media\/193911"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/media?parent=458025"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/operating_system?post=458025"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/use_cases?post=458025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}