Skip to content

Active Directory⚓︎

AD Inventory Lists⚓︎

:: All OUs
dsquery ou DC=<domain>,DC=<tld>

:: All DCs
netdom query dc

:: All Servers
netdom query server
dsquery computer "OU=<servers>,DC=<domain>,DC=<tld>"

:: All Workstations
netdom query workstation
dsquery computer "OU=<workstations>,DC=<domain>,DC=<tld>"

:: OUs which user has rights to create computer object
netdom query ou

:: FSMO servers
netdom query fsmo

Password Management⚓︎

Reset a user password securely, enable the account, and force the user to reset it on next logon.

$NewPassword = (Read-Host -Prompt "Provide New Password" -AsSecureString)
Set-ADAccountPassword <user> -NewPassword $NewPassword -Reset -PassThru | Set-ADUser -ChangePasswordAtLogon $True -Enabled $True