Vous êtes sur la page 1sur 3

Opérations courantes :

1. Installer Widnows core


2. Redémarrer le serveur
restart-computer ou shutdown /r
3. Arrêter le serveur :
stop-computer ou shutdown /s
4. Renommer l’ordinateur
rename-computer ‘’DC200 ‘’ -restart
ou
Rename-Computer -NewName 'PC' -restart

5. Configurer l’adresse IP :
 Afficher les cartes réseau Get-NetAdapter , Get-NetIPInterface
Permet d’afficher les adresses ip Get-NetIpAddress
 Configurer une carte réseau avec numéro d’index donné
New-NetIPAddress –InterfaceIndex 2 –IPAddress 192.168.10.90 –
PrefixLength 24 –DefaultGateway 192.168.10.1

 Activer la carte réseau


Enable-NetAdapter ethernet0
 Désactiver la carte réseau
Disable-NetAdapter ethernet0
6. Joindre un ordinateur au Domaine en ligne
add-Computer –DomainName massira.local –Restart
7. Active l’adressage dynamqiue (DHCP)
Set-NetIPInterface -InterfaceIndex 3 -Dhcp Enabled
8. Désactiver l’adressaage dynamique
Set-NetIPInterface -InterfaceIndex 3 -Dhcp disabled

9. Configurer l’adresse du serveur dns préféré :


Set-DnsClientServerAddress -InterfaceIndex 3 -ServerAddresses
192.168.10.10,8.8.8.8
Afficher la configuration IP:
Get-NetIPConfiguration
10.Ajouter le role ADDS
11.Installer le rôle ADDS
Install-WindowsFeature -Name AD-domain-services -IncludeAllSubFeature -
IncludeManagementTools
12.Promouvoir le serveur en Contrôleur de domaine (Ajouter une nouvelle Forêt)
Install-ADDSForest -DomainName ofppt.local -installdns
Rq: au cas vous n’avez pas mis un mot de passe pour le compte administrateur, uiliser la
commande (net user administrateur admin.123)
13. Promouvoir le serveur en Contrôleur de domaine (Ajouter un contrôleur de
domaine à un domaine existant)
Install-ADDSDomainController -installDns -Credential(Get- Credential "massira\Administrateur")
-DomainName "massira.local"

Gestion des Objets ADDS


14.Créer une Unité Organisationnelle
New-ADOrganizationalUnit -Name TRI -Path "dc=ofppt,dc=local"
New-ADOrganizationalUnit -Name TRI201 -PATH
"OU=TRI,DC=ofppt,DC=local"
New-ADOrganizationalUnit -Name TRI202 -PATH
"OU=TRI,DC=ofppt,DC=local"
15.Afficher toutes les Unités Organisationnelle
Afficher toutes les : OU : Get-ADOrganizationalUnit -filter *
Afficher sous forme de tableau :
Get-ADOrganizationalUnit -filter * | Format-Table
16.Créer un compte utilisateur
New-ADUser -Name "K.kamali" -CannotChangePassword $true -City
"eljadida" -ChangePasswordAtLogon $true -Dep
artment "RH" -Enabled $true -GivenName "kamal" -SamAccountName
"k.kamali" -Surname "kamali" -AccountPassword(Read-Host -AsSecureString
"Entrez le mot de passe")
Afficher la liste :
Get-ADUser -filter *
Get-ADUser -filter * | Format-Table
17.Modifier les propriétés d’un utilisateur
Set-ADUser -identity "cn=k.kamali,cn=users,dc=ofppt,dc=local" -Enabled
$false -GivenName "jamal"
18.Supprimer un Compte Utilisateur
Remove-ADUser -Identity "cn=k.kamali,cn=users,dc=ofppt, dc=local"
19.Reconfigurer le conteneur de l'ordinateur par défaut (computers)
Redircomp ‘’ ou=tri ,dc=ofppt,dc=local’’
20.Reconfigurer le conteneur de l’utilisateur par défaut (users)
redirusr.exe "ou=tri,dc=ofppt,dc=local"
21.Activer un Compte utilisateur ou ordinateur
Enable-ADAccount -Identity "cn=a.benani,cn=users,dc=ofppt,dc=local"
Set-ADUser -Identity "cn=t.berada,ou=tri,dc=ofppt,dc=local" -Enabled $true
22.Désactiver un Compte utilisateur ou ordinateur
Disable-ADAccount -Identity "cn=a.benani,cn=users,dc=ofppt,dc=local"
23.Créer un groupe de distribution
New-ADGroup groupe2 -GroupCategory Distribution -GroupScope Global
24.Créer un groupe de sécurité et étendue globale
New-ADGroup Groupe1 -GroupCategory Security -GroupScope Global
25.Renommer un Objet ADDS
Rename-ADObject -Identity "cn=groupe2, ou=tri,dc=ofppt,dc=local" -NewName
"test1"

Vous aimerez peut-être aussi