This document contains Git, Windows, networking, PowerShell, and Active Directory commands used throughout the Active Directory Home Lab.
git statusDisplays modified files, untracked files, staged files, and current branch status.
git add .Adds all new and modified files to the staging area.
git commit -m "Commit message"Creates a snapshot of the staged changes.
git push origin mainUploads local commits to GitHub.
git pull origin mainDownloads and merges changes from GitHub into the local repository.
git log --onelineDisplays a concise list of previous commits.
git remote -vShows the GitHub repository associated with the local project.
git clone https://github.com/Amaggs99/Active-Directory-Lab.gitDownloads a copy of the repository from GitHub.
touch filename.mdExample:
touch README.md
touch Documentation/Project-Summary.mdmkdir FolderNameExample:
mkdir Documentation
mkdir ScreenshotslsDisplays files and folders in the current directory.
mv oldname newnameExample:
mv Commands-Used.md.txt Commands-Used.mdcd directory-nameExample:
cd Documentation
cd ..
cd ScreenshotspwdDisplays the full path of the current working directory.
ipconfig /allDisplays detailed network adapter information.
ipconfig /flushdnsClears the DNS resolver cache.
ping 192.168.66.10Tests communication with the Domain Controller.
nslookup adlab.localVerifies DNS resolution for the Active Directory domain.
route printDisplays the local routing table.
Import-Module ActiveDirectoryLoads the Active Directory PowerShell module.
Get-ADDomainDisplays Active Directory domain information.
Get-ADForestDisplays Active Directory forest information.
New-ADOrganizationalUnit -Name "Users" -Path "OU=Company,DC=adlab,DC=local"Creates a new Organizational Unit.
New-ADGroup -Name "IT_Admins" -GroupScope Global -GroupCategory Security -Path "OU=Groups,OU=Company,DC=adlab,DC=local"Creates a new Active Directory security group.
New-ADUser -Name "John Smith" -SamAccountName jsmith -AccountPassword (ConvertTo-SecureString "Password123!" -AsPlainText -Force) -Enabled $trueCreates and enables a new Active Directory user.
Add-ADGroupMember -Identity "IT_Admins" -Members jsmithAdds a user to an Active Directory group.
Get-ADUser -Filter * -SearchBase "OU=Users,OU=Company,DC=adlab,DC=local" | Select Name,SamAccountName,EnabledDisplays users created inside the lab Users OU.
Get-ADGroup -Filter * -SearchBase "OU=Groups,OU=Company,DC=adlab,DC=local" | Select NameDisplays groups created inside the lab Groups OU.
dcdiag /vRuns detailed diagnostic tests against the Domain Controller.
dcdiag /test:DNSChecks DNS health for the Domain Controller.
Get-Service NTDS,DNS,Netlogon,KDCVerifies that core Active Directory services are running.
Get-Service VMToolsChecks whether VMware Tools is installed and running.
Rename-Computer -NewName "CLIENT01" -RestartRenames the Windows client and restarts the machine.
Add-Computer -DomainName adlab.local -Credential adlab\Administrator -RestartJoins the Windows client to the Active Directory domain.
whoamiShows the currently logged-in user.
Example:
adlab\administrator
hostnameDisplays the local computer name.
dsa.mscOpens Active Directory Users and Computers.
gpmc.mscOpens Group Policy Management Console.
dnsmgmt.mscOpens DNS Manager.
servermanagerOpens Server Manager.
sysdm.cplOpens System Properties.
ncpa.cplOpens Network Connections.
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled FalseUsed temporarily during troubleshooting to test connectivity.
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled TrueRe-enables Windows Firewall.
Enable-NetFirewallRule -DisplayGroup "File and Printer Sharing"Allows ICMP/ping responses through Windows Firewall.
VM → Snapshot → Take Snapshot
Creates a restore point of the lab environment.
VM → Snapshot → Snapshot Manager
Restores the VM to a previous lab state.
VM → Install VMware Tools
Mounts VMware Tools inside the guest operating system.
Edit → Virtual Network Editor
Used to verify VMnet1 Host-Only and VMnet8 NAT configuration.
These commands were used throughout the Active Directory Home Lab to deploy, troubleshoot, and administer the environment. They serve as a quick reference for future projects, documentation, and interview preparation.