Does anyone know if the Microsoft PowerShell Active Directory module calls the System.DirectoryServices.AccountManagement .Net namespace? Or if Microsoft have open sourced the module so that I can look myself.
I'm trying to draw out a stack topology and suddenly realised that I don't really know what cmdlets such as Get-ADUser and New-ADUser do internally and what if anything they call (ie how abstracted they are).
It's not exactly the same, but very similar.
Get-ADUser
for example, returns a Microsoft.ActiveDirectory.Management.ADUser
object. Compare that to UserPrincipal
and you'll see they're different, not only in the namespace, but in the properties, etc. However there is still a lot of abstraction going on, and thus overhead.
If you're worried about performance, you can always just use .NET's DirectoryEntry
from PowerShell. There are actually type accelerators just for DirectoryEntry
and DirectorySearcher
.
([adsisearcher]'samaccountname=jaap').FindOne() #DirectorySearcher
[adsi]'LDAP://CN=Jaap,OU=AdminUsers,DC=JaapBrasser,DC=Com' #DirectoryEntry
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.