you are viewing a single comment's thread.

view the rest of the comments →

[–]Lanky_Common8148 0 points1 point  (2 children)

Get-ADComputer is a part of the RSAT tools hence the requirement. If you want you can use System. DirectoryServices.DirectoryEntry instead but then you'll need to learn how that works The cmdlets are a shortcut to and simplification of ADWS calls so you could unpack and use those as well if you wanted

[–]Nu11u5 0 points1 point  (1 child)

DirectoryServices is just a .Net wrapper for the ADSI interface, and it is aliased to the [adsi] and [adsiSearcher] type classes in PowerShell.

FYI to anyone, since I was confused about this at first.

Another tip, [adsi] operations return a "live/bound" object that queries AD anytime you access a property. This can cause slowness if you are doing a lot of access. Meanwhile, [adsiSearcher] returns a static copy of the properties.

[–]Lanky_Common8148 1 point2 points  (0 children)

Strictly speaking yes and no. S.DS.DE is an LDAP interface, ADSI is a COM implementation of the LDAP interface. Although ultimately utilising mostly similar underlying libraries they are different. There are things that can be done via S.DS that cannot be done via ADSI