02 - Lab 01
02 - Lab 01
Wait few seconds until all roles are displayed then click on "AD DS" in the left pane.
on the right pane, Right click on server DC01 and select "Active Directory Administrative
Center" element.
Click on "OK".
Open a PowerShell command prompt either via start menu (right click)
or by entering the command " powershell " in "run" menu (right click) :
First we convert the plaintext password to a password object we can use :
This script utilizes the New-ADUser cmdlet from Active Directory module to create a new
user. This module is loaded by default in a Domain Controller.
Get-ADUser "PowerShellUser"
a window will pop-up to select destination. click on DestinationOU then validate by clicking
on OK
The user account is moved and we can check it by selecting the DestinationOU
Using PowerShell
To move the "PowerShellUser" from the default "Users" container to the DestinationOU we
can use the Move-ADObject cmdlet in PowerShell:
Done.
Using Powershell
To delete the user named "PowerShellUser" using PowerShell, you can use the Remove-
ADUser cmdlet from the Active Directory module. Here's the command:
This command will remove the user " PowerShellUser " from Active Directory.
The -Identity parameter specifies the identity of the user to be deleted, and -
Confirm:$false is added to bypass the confirmation prompt and directly delete the user.
Using dsrm command
You can use the dsrm command to delete a user in Active Directory from the command line.
Here's the command to delete the "DsAddUser":