Fixing issues 228, 252, 255

This commit is contained in:
Chris Long
2019-04-25 23:06:07 -07:00
parent 574df0e0c4
commit dae0393b00
12 changed files with 101 additions and 40 deletions

View File

@@ -0,0 +1,29 @@
# Purpose: Install the GPO that allows windomain\vagrant to RDP
Write-Host "Importing the GPO to allow windomain/vagrant to RDP..."
Import-GPO -BackupGpoName 'Allow Domain Users RDP' -Path "c:\vagrant\resources\GPO\rdp_users" -TargetName 'Allow Domain Users RDP' -CreateIfNeeded
$OU = "ou=Workstations,dc=windomain,dc=local"
$gPLinks = $null
$gPLinks = Get-ADOrganizationalUnit -Identity $OU -Properties name,distinguishedName, gPLink, gPOptions
$GPO = Get-GPO -Name 'Allow Domain Users RDP'
If ($gPLinks.LinkedGroupPolicyObjects -notcontains $gpo.path)
{
New-GPLink -Name 'Allow Domain Users RDP' -Target $OU -Enforced yes
}
else
{
Write-Host "Allow Domain Users RDP GPO was already linked at $OU. Moving On."
}
$OU = "ou=Servers,dc=windomain,dc=local"
$gPLinks = $null
$gPLinks = Get-ADOrganizationalUnit -Identity $OU -Properties name,distinguishedName, gPLink, gPOptions
$GPO = Get-GPO -Name 'Allow Domain Users RDP'
If ($gPLinks.LinkedGroupPolicyObjects -notcontains $gpo.path)
{
New-GPLink -Name 'Allow Domain Users RDP' -Target $OU -Enforced yes
}
else
{
Write-Host "Allow Domain Users RDP GPO was already linked at $OU. Moving On."
}
gpupdate /force