Difference between revisions of "Active Directory (PowerShell)"

Jump to navigation Jump to search
m
→‎Computers: Added "Remove-ADComputer"
m (→‎Remove-ADUser examples: Added warning)
m (→‎Computers: Added "Remove-ADComputer")
 
Line 149: Line 149:


== Computers ==
== Computers ==
To disable a computer account, use <code>Disable-ADAccoun</code>
=== <code>Get-ADComputer</code> examples ===
=== <code>Get-ADComputer</code> examples ===
<source lang="powershell">
<source lang="powershell">
Line 154: Line 155:
</source>
</source>
* '''LastLogonDate''' - Be aware that the last logon date field typically has an accuracy/tolerance of 14 days, AD intentionally doesn't update the field at every logon from the user/device object so as to reduce the amount of data replication between domain controllers
* '''LastLogonDate''' - Be aware that the last logon date field typically has an accuracy/tolerance of 14 days, AD intentionally doesn't update the field at every logon from the user/device object so as to reduce the amount of data replication between domain controllers
=== <code>Remove-ADComputer</code> examples ===
<source lang="powershell">
Remove-ADComputer -Identity $computer -Confirm:$false
</source>


== Organisation Unit ==
== Organisation Unit ==

Navigation menu