dsccommunity / ActiveDirectoryDsc

This module contains DSC resources for deployment and configuration of Active Directory Domain Services.
MIT License
341 stars 141 forks source link

Issue: General question AdUser supporting custom extended schemas properties #630

Open albvar opened 4 years ago

albvar commented 4 years ago

Hello,

My environment has had the AD user schema extended to have ExtensionAttribute1-15. I am currently supporting this by leveraging native Set-AdUser -Replace @{Extensionattribute1 = 'myvalue'} Retrieval involves Get-AdUser abc -Properties ExtensionAttribute1 Is this possible to support within the AdUser resource? Wanted to ask for guidance, thanks in advance.

johlju commented 4 years ago

I think it would be fairly easy to add those properties as parameters to the resource. They are just handled as text values right? So the would be added like a similar property like Description. 🤔

X-Guardian commented 3 years ago

It would not make sense to include these as standard properties of the ADUser resource as they are not part of the standard AD Schema. The only sensible way to support this would be adding an OtherAttributes hashtable property to the ADUser resource, the same as the New-ADUser cmdlet uses in this scenario. This would need to make use of the EmbeddedInstance("MSFT_KeyValuePair") MOF resource type.

albvar commented 2 years ago

It would not make sense to include these as standard properties of the ADUser resource as they are not part of the standard AD Schema. The only sensible way to support this would be adding an OtherAttributes hashtable property to the ADUser resource, the same as the New-ADUser cmdlet uses in this scenario. This would need to make use of the EmbeddedInstance("MSFT_KeyValuePair") MOF resource type.

I am still highly interested in seeing this functionality supported. Any additional guidance in terms of using "EmbeddedInstance("MSFT_KeyValuePair") MOF resource type."? If I can understand how to implement this I could potentially contribute the changes back to the repo and currently have the bandwidth to do so.

johlju commented 2 years ago

For reference how to implement it can be found in this resource https://github.com/dsccommunity/DnsServerDsc/blob/main/source/DSCResources/DSC_DnsServerRootHint/DSC_DnsServerRootHint.psm1. See both the schema and the code.