« Active directory » : différence entre les versions
Apparence
Aucun résumé des modifications |
|||
Ligne 1 : | Ligne 1 : | ||
[[Category:Windows]] | [[Category:Windows]] | ||
[[Category:CSharp]] | |||
= [http://www.fixedbyvonnie.com/2015/04/understanding-active-directory-in-windows-server-2012-r2-part-2-of-3/#.WfxkAYgo870 Installation sur Windows Server 2012] = | = [http://www.fixedbyvonnie.com/2015/04/understanding-active-directory-in-windows-server-2012-r2-part-2-of-3/#.WfxkAYgo870 Installation sur Windows Server 2012] = | ||
Server Manager Dashboard → Add roles and features → Role-based | Server Manager Dashboard → Add roles and features → Role-based |
Dernière version du 20 février 2022 à 17:13
Installation sur Windows Server 2012
Server Manager Dashboard → Add roles and features → Role-based
- AD Domain Services
- AD Federation Services
Server Manager Dashboard → AD DS → more → promote this server to a domain controller
- Add a New Forest
- Root domain name: domain.ch
![]() |
Le serveur doit avoir une IP fixe. |
Scripts PowerShell
![]() |
Installer Remote Server Administration Tools for Windows 10 si besoin (The specified module 'activedirectory' was not loaded) |
import-module activedirectory
# Afficher toutes les propriétés des tous les comptes *NAME*
Get-ADUser -Filter {EmailAddress -like "*NAME*"} -properties *
# Afficher tous les comptes utilisateur
Get-ADUser -Filter {ObjectClass -eq "user"}
# Afficher tous les comptes utilisateur *NAME*
Get-ADObject -Filter {(mail -like "*NAME*") -and (ObjectClass -eq "user")}
|
Ajouter un utilisateur
- Server Manager → AD DS → clique-droit sur le serveur → AD Users and Computers
- clique-droit sur domain.ch → New → Organisational Unit
- clique-droit sur l'OU → New → User
ADWS
- Endpoints par défaut: netTCP Binding sur le port 9389
- pas de support HTTP-binding
NetTcpBinding tcpBind = new NetTcpBinding();
var acctMgmt = new ADWSSvc.AccountManagementClient(tcpBind,
new EndpointAddress("net.tcp://localhost:9389/ActiveDirectoryWebServices/Windows/AccountManagement"));
acctMgmt.ClientCredentials.Windows.AllowedImpersonationLevel =
System.Security.Principal.TokenImpersonationLevel.Impersonation;
var adPrincipal = acctMgmt.GetADGroupMember("ldap:389",
"CN=Domain Admins,CN=Users,DC=corp,DC=claimsauth,DC=com",
"DC=corp,DC=claimsauth,DC=com",
true);
foreach (var item in adPrincipal)
{
Console.WriteLine(item.Name);
Console.WriteLine(item.DistinguishedName);
Console.WriteLine(item.SamAccountName);
}
|
Liens
- What's New in AD DS: Active Directory Web Services
- ADWS with HTTP Binding and access from a Java Client
- Active Directory Web Services Overview
- How to view SOAP XML messages to and from AD Webservices and Powershell
- Using Active Directory Web Services in C#/Visual Studio
- Example of ChangePassword
Local users and groups
using System.DirectoryServices;
var ad = new DirectoryEntry($"WinNT://{Environment.MachineName},computer");
var user = ad.Children.Find("Bibi", "user");
var adminGroup = ad.Children.Find("Administrators", "group");
adminGroup.Invoke("Add", new object[] { user.Path }); // add the user to the admin group
|
LDAP
User Info
|
Change Password
|
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Le compte qui fait tourner le service n'a pas le droit de modifier un password.
Specify an Identity for an Application Pool:
- IIS Manager → clique sur Application Pools
- clique-droit sur le site à modifier → Advanced Settings → Process Model → Identity
- Custom Account