ActiveDirectoryDsc
ActiveDirectoryDsc copied to clipboard
Issue: General question AdUser supporting custom extended schemas properties
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.
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. 🤔
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.
It would not make sense to include these as standard properties of the
ADUserresource as they are not part of the standard AD Schema. The only sensible way to support this would be adding anOtherAttributeshashtableproperty to theADUserresource, the same as theNew-ADUsercmdlet uses in this scenario. This would need to make use of theEmbeddedInstance("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.
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.