All Projects → rgl → Windows Domain Controller Vagrant

rgl / Windows Domain Controller Vagrant

Example Windows Domain Controller

Programming Languages

powershell
5483 projects

Projects that are alternatives of or similar to Windows Domain Controller Vagrant

Ansible Windows Docker Springboot
Example project showing how to provision, deploy, run & orchestrate Spring Boot apps with Docker Windows Containers on Docker Windows native using Packer, Powershell, Vagrant & Ansible
Stars: ✭ 58 (-30.12%)
Mutual labels:  vagrant
Vagrant Foodshow
Vagrant plugin for ngrok
Stars: ✭ 70 (-15.66%)
Mutual labels:  vagrant
Vagrant Librarian Chef
*UNMAINTAINED* A Vagrant plugin to install Chef cookbooks using Librarian-Chef.
Stars: ✭ 80 (-3.61%)
Mutual labels:  vagrant
Vagrant Ova Plugin
Vagrant plugin that export a box from vbox to vmwware
Stars: ✭ 62 (-25.3%)
Mutual labels:  vagrant
Molecule Vagrant
Molecule Vangrant Driver
Stars: ✭ 69 (-16.87%)
Mutual labels:  vagrant
Molecule Ansible Docker Aws
Example project showing how to test Ansible roles with Molecule using Testinfra and a multiscenario approach with Docker, Vagrant & AWS EC2 as infrastructure providers
Stars: ✭ 72 (-13.25%)
Mutual labels:  vagrant
Vagrant Appindicator
Vagrant Application Indicator for Ubuntu
Stars: ✭ 48 (-42.17%)
Mutual labels:  vagrant
Jjg Ansible Windows
[DEPRECATED] Windows shell provisioning script to bootstrap Ansible from within a Vagrant VM.
Stars: ✭ 82 (-1.2%)
Mutual labels:  vagrant
Rubel
Rubel is a cms built with Laravel and React.
Stars: ✭ 70 (-15.66%)
Mutual labels:  vagrant
Packer Centos 6
This build has been moved - see README.md
Stars: ✭ 78 (-6.02%)
Mutual labels:  vagrant
Graphite Stack Ansible Vagrant
Provision a complete Graphite, StatsD & Grafana install using Ansible and (optionally) Vagrant
Stars: ✭ 62 (-25.3%)
Mutual labels:  vagrant
Vagrant Cloudstack
Use Vagrant to manage your Cosmic or Cloudstack instances.
Stars: ✭ 65 (-21.69%)
Mutual labels:  vagrant
Splunkenizer
Ansible framework providing a fast and simple way to spin up complex Splunk environments.
Stars: ✭ 73 (-12.05%)
Mutual labels:  vagrant
Shopware Vagrant
A Vagrant setup ready for shopware development
Stars: ✭ 58 (-30.12%)
Mutual labels:  vagrant
Packer Ubuntu 1404
DEPRECATED - Packer Example - Ubuntu 14.04 Vagrant Box using Ansible provisioner
Stars: ✭ 81 (-2.41%)
Mutual labels:  vagrant
Osx Vm Templates
macOS templates for Packer and VeeWee.
Stars: ✭ 1,050 (+1165.06%)
Mutual labels:  vagrant
Showcase Ansible Chatops
Vagrant Demo showing ChatOps with Ansible
Stars: ✭ 71 (-14.46%)
Mutual labels:  vagrant
Laravel Whoops Editor
Laravel Whoops Editor helps to open your code editor from exception stack trace.
Stars: ✭ 83 (+0%)
Mutual labels:  vagrant
Kubernetes The Ansible Way
Bootstrap Kubernetes the Ansible way on Everything (here: Vagrant). Inspired by Kelsey Hightower´s kubernetes-the-hard-way, but refactored to Infrastructure-as-Code.
Stars: ✭ 82 (-1.2%)
Mutual labels:  vagrant
Jenkins Infra
Jenkins main control repo for R10k and our Puppet Enterprise managed infrastructure
Stars: ✭ 76 (-8.43%)
Mutual labels:  vagrant

This is an example on how to create a Windows Domain Controller using Vagrant and PowerShell.

This also shows how to add a Computer to an existing domain using PowerShell.

This will create an example.com Active Directory Domain Forest.

This will also install a Certification Authority with a GPO to automatically enroll computers with a certificate signed by the trusted domain CA, Remote Desktop users will therefore see and use trusted certificates.

This will also set the user photo with a GPO.

This will also set the Remote Desktop Users group with a GPO.

This will also setup the whoami group Managed Service Account (gMSA).

This setup will use the following static IP addresses:

IP Hostname Description
192.168.56.2 dc.example.com Domain Controller Computer
192.168.56.3 windows.example.com Test Windows Computer
192.168.56.4 ubuntu.example.com Test Ubuntu Computer

NB these are hardcoded in several files. Find then with grep -r 192.168.56. ..

Install the Windows 2019 base box.

Install the Ubuntu 20.04 base box.

Install the required Vagrant plugins:

vagrant plugin install vagrant-windows-sysprep
vagrant plugin install vagrant-reload

Start by launching the Domain Controller environment:

vagrant up --provider=virtualbox # or --provider=libvirt

Launch the test nodes:

cd test-nodes
vagrant up --provider=virtualbox # or --provider=libvirt

Sign-in on the test nodes with one of the following accounts:

  • Username john.doe and password HeyH0Password.
    • This account is also a Domain Administrator.
  • Username jane.doe and password HeyH0Password.
  • Username Administrator and password HeyH0Password.
    • This account is also a Domain Administrator.
  • Username .\vagrant and password password.
    • NB you MUST use the local vagrant account. because the domain also has a vagrant account, and that will mess-up the local one...

You can login at the machine console.

You can login with remote desktop, e.g.:

xfreerdp /v:192.168.56.2 /u:john.doe /p:HeyH0Password /size:1440x900 +clipboard

You can login with ssh, e.g.:

ssh [email protected]

Active Directory LDAP

You can use a normal LDAP client for acessing the Active Directory.

It accepts the following Bind DN formats:

  • <userPrincipalName>@<DNS domain>, e.g. [email protected]
  • <sAMAccountName>@<NETBIOS domain>, e.g. [email protected]
  • <NETBIOS domain>\<sAMAccountName>, e.g. EXAMPLE\jane.doe
  • <DN for an entry with a userPassword attribute>, e.g. CN=jane.doe,CN=Users,DC=example,DC=com

NB sAMAccountName MUST HAVE AT MOST 20 characters.

Some attributes are available in environment variables:

Attribute Environment variable Example
sAMAccountName USERNAME jane.doe
sAMAccountName USERPROFILE C:\Users\jane.doe
NETBIOS domain USERDOMAIN EXAMPLE
DNS domain USERDNSDOMAIN EXAMPLE.COM

You can list all of the active users using ldapsearch as:

ldapsearch \
  -H ldap://dc.example.com \
  -D [email protected] \
  -w HeyH0Password \
  -x -LLL \
  -b CN=Users,DC=example,DC=com \
  '(&(objectClass=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))' \
  sAMAccountName userPrincipalName userAccountControl displayName cn mail

NB To have ldapsearch you can install the msys2 mingw-w64-openldap package with pacman -Sy mingw-w64-x86_64-openldap.

For TLS, use -H ldaps://dc.example.com, after creating the ldaprc file with:

openssl x509 -inform der -in tmp/ExampleEnterpriseRootCA.der -out tmp/ExampleEnterpriseRootCA.pem
cat >ldaprc <<'EOF'
TLS_CACERT tmp/ExampleEnterpriseRootCA.pem
TLS_REQCERT demand
EOF

Troubleshoot TLS with:

# see the TLS certificate validation result:
echo | openssl s_client -connect dc.example.com:636 -servername dc.example.com -CAfile tmp/ExampleEnterpriseRootCA.pem
# see the TLS certificate being returned by the server:
echo | openssl s_client -connect dc.example.com:636 -servername dc.example.com | openssl x509 -noout -text -in -

Active Directory DNS

You can update the DNS zone using the computer principal credentials, e.g.:

kinit --keytab=/etc/sssd/sssd.keytab 'ubuntu$'
nsupdate -g <<'EOF'
server dc.example.com
zone example.com.
update delete ubuntu.example.com. in A
update add ubuntu.example.com. 60 in A 192.168.56.4
update delete ubuntu.example.com. in TXT
update add ubuntu.example.com. 60 in TXT "hello world"
send
EOF
kdestroy

Hyper-V Usage

Follow the rgl/windows-vagrant Hyper-V Usage section.

Create the required virtual switches:

PowerShell -NoLogo -NoProfile -ExecutionPolicy Bypass <<'EOF'
@(
  @{Name='windows-domain-controller'; IpAddress='192.168.56.1'}
) | ForEach-Object {
  $switchName = $_.Name
  $switchIpAddress = $_.IpAddress
  $networkAdapterName = "vEthernet ($switchName)"
  $networkAdapterIpAddress = $switchIpAddress
  $networkAdapterIpPrefixLength = 24

  # create the vSwitch.
  New-VMSwitch -Name $switchName -SwitchType Internal | Out-Null

  # assign it an host IP address.
  $networkAdapter = Get-NetAdapter $networkAdapterName
  $networkAdapter | New-NetIPAddress `
    -IPAddress $networkAdapterIpAddress `
    -PrefixLength $networkAdapterIpPrefixLength `
    | Out-Null
}

# remove all virtual switches from the windows firewall.
Set-NetFirewallProfile `
  -DisabledInterfaceAliases (
        Get-NetAdapter -name "vEthernet*" | Where-Object {$_.ifIndex}
    ).InterfaceAlias
EOF
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].