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

@@ -1,7 +1,7 @@
# Purpose: Install the GPO that specifies the WEF collector
Write-Host "Importing the GPO to enable Powershell Module, ScriptBlock and Transcript logging..."
Import-GPO -BackupGpoName 'Powershell Logging' -Path "c:\vagrant\resources\GPO\powershell_logging" -TargetName 'Powershell Logging' -CreateIfNeeded
$OU = "ou=Workstations,dc=windomain,dc=local"
$OU = "ou=Workstations,dc=windomain,dc=local"
$gPLinks = $null
$gPLinks = Get-ADOrganizationalUnit -Identity $OU -Properties name,distinguishedName, gPLink, gPOptions
$GPO = Get-GPO -Name 'Powershell Logging'
@@ -11,9 +11,9 @@ If ($gPLinks.LinkedGroupPolicyObjects -notcontains $gpo.path)
}
else
{
Write-Host "Powershell Loggin was already linked at $OU. Moving On."
Write-Host "Powershell Logging was already linked at $OU. Moving On."
}
$OU = "ou=Servers,dc=windomain,dc=local"
$OU = "ou=Servers,dc=windomain,dc=local"
$gPLinks = $null
$gPLinks = Get-ADOrganizationalUnit -Identity $OU -Properties name,distinguishedName, gPLink, gPOptions
$GPO = Get-GPO -Name 'Powershell Logging'
@@ -23,7 +23,7 @@ If ($gPLinks.LinkedGroupPolicyObjects -notcontains $gpo.path)
}
else
{
Write-Host "Powershell Loggin was already linked at $OU. Moving On."
Write-Host "Powershell Logging was already linked at $OU. Moving On."
}
$OU = "ou=Domain Controllers,dc=windomain,dc=local"
$gPLinks = $null
@@ -34,6 +34,6 @@ If ($gPLinks.LinkedGroupPolicyObjects -notcontains $gpo.path)
}
else
{
Write-Host "Powershell Loggin was already linked at $OU. Moving On."
Write-Host "Powershell Logging was already linked at $OU. Moving On."
}
gpupdate /force

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

View File

@@ -1,19 +1,20 @@
# Purpose: Installs chocolatey package manager, then installs custom utilities from Choco.
If (-not (Test-Path "C:\ProgramData\chocolatey")) {
Write-Host "Installing Chocolatey"
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
} else {
Write-Host "Chocolatey is already installed."
}
Write-Host "Installing utilities..."
If ($(hostname) -eq "win10") {
# Because the Windows10 start menu sucks
choco install -y classic-shell -installArgs ADDLOCAL=ClassicStartMenu
}
choco install -y NotepadPlusPlus
choco install -y GoogleChrome
choco install -y WinRar
Write-Host "Utilties installation complete!"
# Purpose: Installs chocolatey package manager, then installs custom utilities from Choco.
If (-not (Test-Path "C:\ProgramData\chocolatey")) {
Write-Host "Installing Chocolatey"
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
} else {
Write-Host "Chocolatey is already installed."
}
Write-Host "Installing utilities..."
If ($(hostname) -eq "win10") {
# Because the Windows10 start menu sucks
choco install -y classic-shell -installArgs ADDLOCAL=ClassicStartMenu
reg import "c:\vagrant\resources\windows\classic_shell_win7.reg"
}
choco install -y NotepadPlusPlus
choco install -y GoogleChrome
choco install -y WinRar
Write-Host "Utilties installation complete!"