Active Directory
AD Inventory Lists
Batchfile |
---|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 | :: 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.
PowerShell |
---|
| $NewPassword = (Read-Host -Prompt "Provide New Password" -AsSecureString)
Set-ADAccountPassword <user> -NewPassword $NewPassword -Reset -PassThru | Set-ADUser -ChangePasswordAtLogon $True -Enabled $True
|