This exercise I will cover the seven most used PowerShell commands helping you to use Active Directory. New-ADOrganizationalUnit,New-ADUser,NEW-ADGroup,ADD-ADGroupMember,New-MailboxDatabase, Enable-Mailbox,Set-ADGroup
# 1 – Create Montreal organizational unit for Montreal employees.
New-ADOrganizationalUnit Montreal
# 2 Create user account Philippe in montreal Organization Unit.
New-ADUser -Name “Philippe” -Enabled $True -path “OU=Montréal,DC=formation,DC=local” -SamAccountName “Philippe” -UserPrincipalName “[email protected]” -AccountPassword (ConvertTo-SecureString “Motdepasse2016” -AsPlainText -force)
# 3 Create the following groups: Inventory
NEW-ADGroup –name “Inventory” –groupscope Global
# 4 Add user Philippe to Inventory group
ADD-ADGroupMember “Inventory” –members “Philippe”
# 5 Create mailbox for user Philippe
New-MailboxDatabase lab2 -Server dc
Restart-Service MSExchangeIS
Enable-Mailbox -Identity Philippe -Database lab2
# 6 Create mailbox for Inventory group
Set-ADGroup Inventory -GroupScope Universal
Enable-distributionGroup -Identity Inventory