Cleaned remains and little changes to setupRDP
This commit is contained in:
15
setupRDP.ps1
15
setupRDP.ps1
@@ -17,8 +17,21 @@ function SetupRDP {
|
||||
[bool] $enable
|
||||
)
|
||||
if ($enable) {
|
||||
EnableRDP
|
||||
# check if RPD is already enabled
|
||||
$RDPEnabled = (Get-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections").fDenyTSConnections
|
||||
if ($RDPEnabled -eq 0) {
|
||||
Write-Host "RDP is already enabled!"
|
||||
} else {
|
||||
EnableRDP
|
||||
}
|
||||
} else {
|
||||
DisableRDP
|
||||
# Check if RDP is already disabled
|
||||
$RDPEnabled = (Get-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections").fDenyTSConnections
|
||||
if ($RDPEnabled -eq 1) {
|
||||
Write-Host "RDP is already disabled!"
|
||||
} else {
|
||||
DisableRDP
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ function StandardSetup {
|
||||
SetupUser -username "Prof" -password "IPRprof2398" -description "Compte professeur" -group "Users"
|
||||
SetupUser -username "Admin" -password "Lprsnm4ehk26-" -description "Compte administrateur" -group "Administrators"
|
||||
SetupUserReg -username "Eleve"
|
||||
EnableRDP
|
||||
SetupRDP -enable 1
|
||||
InstallChoco
|
||||
ChocoInstallApps -Type $Type
|
||||
InstallApps -Type $Type
|
||||
@@ -147,7 +147,7 @@ function SetupCustom {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($RDP) { EnableRDP }
|
||||
if ($RDP) { SetupRDP -enable 1 }
|
||||
if ($Choco) {
|
||||
InstallChoco
|
||||
if ($ChocoApps) { ChocoInstallApps -Type "Custom" -Apps $ChocoApps }
|
||||
@@ -197,5 +197,4 @@ if (Test-Path -Path "C:\Windows\System32\CodeIntegrity\CiPolicies\Active\{b4d6b2
|
||||
Remove-Item -Path "C:\Windows\System32\CodeIntegrity\CiPolicies\Active\{b4d6b24c-c3ad-44e5-9dea-72c1ed9577b8}.cip"
|
||||
}
|
||||
}
|
||||
OldImportModules
|
||||
Show-InstallationMenu
|
||||
Reference in New Issue
Block a user