# Execute with Administrator rights$path = $MyInvocation.MyCommand.Pathif ($args[0] -ne $null) {$path = $args[0]}$path = Split-Path -Path $path$windowsID = [System.Security.Principal.WindowsIdentity]::GetCurrent()$windowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal($windowsID)$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administratorif ($windowsPrincipal.IsInRole($adminRole)) {$Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Elevated)"$Host.UI.RawUI.BackgroundColor = "DarkBlue"clear-host}else {$newProcess = New-Object System.Diagnostics.ProcessStartInfo "PowerShell";$newProcess.WorkingDirectory = $path;$newProcess.Arguments = $myInvocation.MyCommand.Definition;$newProcess.Verb = "runas";[System.Diagnostics.Process]::Start($newProcess);exit}# Set RDP enabledSet-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" тАУValue 0# Create firewall ruleNew-NetFirewallRule -DisplayName "Remote Desktop Allow TCP" -Program "%SystemRoot%\system32\svchost.exe" -Action Allow -Protocol TCP -LocalPort 3389 -Direction Inbound -Enabled TrueNew-NetFirewallRule -DisplayName "Remote Desktop Allow UDP" -Program "%SystemRoot%\system32\svchost.exe" -Action Allow -Protocol UDP -LocalPort 3389 -Direction Inbound -Enabled True# Add user to RDU group$User = $env:USERNAMEAdd-LocalGroupMember -SID "S-1-5-32-555" -Member $User
рдореВрдирд▓рд╛рдЗрдЯ (рдкреВрд░реНрд╡ рдореЗрдВ рд▓рд╛рдЗрдорд▓рд╛рдЗрдЯ) NVIDIA рдЧреЗрдорд╕реНрдЯреНрд░реАрдо рдкреНрд░реЛрдЯреЛрдХреЙрд▓ рдХрд╛ рдПрдХ рдЦреБрд▓рд╛ рд╕реНрд░реЛрдд рдХрд╛рд░реНрдпрд╛рдиреНрд╡рдпрди рд╣реИред рд╣рдордиреЗ NVIDIA рд╢реАрд▓реНрдб рджреНрд╡рд╛рд░рд╛ рдЙрдкрдпреЛрдЧ рдХрд┐рдП рдЧрдП рдкреНрд░реЛрдЯреЛрдХреЙрд▓ рдХреЛ рд▓рд╛рдЧреВ рдХрд┐рдпрд╛ рдФрд░ рддреАрд╕рд░реЗ рдкрдХреНрд╖ рдХреЗ рдЧреНрд░рд╛рд╣рдХреЛрдВ рдХрд╛ рдПрдХ рд╕реЗрдЯ рд▓рд┐рдЦрд╛ред