The AD modules have worked with PowerShell Core (on Windows) for a while now. You just need to make sure your Windows install is new enough to contain the compatible cmdlets. For me the AD cmdlets work on Server 2019 which I believe is on the same build as Windows 10 1809. Potentially older versions also work but I don't have any of those builds to test.
PS C:\Windows\system32> $PSVersionTable
Name Value
---- -----
PSVersion 6.2.4
PSEdition Core
GitCommitId 6.2.4
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS C:\Windows\system32> Get-ADUser vagrant-domain
DistinguishedName : CN=vagrant-domain,CN=Users,DC=domain,DC=local
Enabled : True
GivenName :
Name : vagrant-domain
ObjectClass : user
ObjectGUID : 928a0ddf-e92b-4c7f-8d59-3337956f5c94
SamAccountName : vagrant-domain
SID : S-1-5-21-2959096244-3298113601-420842770-1104
Surname :
UserPrincipalName : [email protected]
I’m pretty sure server 2016 is based on Windows 10 1607 which definitely doesn’t have the ad module version that supports PowerShell core. PowerShell 7 should still have a way to import modules that aren’t compatible through implicit remoting but you would have to test that.
0
u/[deleted] Mar 04 '20
[deleted]