Last week, released xAzureAD.DirectorySetting without a lot of thought. Over the weekend, I was thinking that it would be great to make it a bit more extensible and work with all of the various types of templates available. So, I now have the latest release, xAzureAD.DirectorySetting v0.2.

Changes

First, I changed the name of the principal function from Set-AzureADGroupsSetting to Set-AzureADDirectorySetting. This literally makes it a wrapper function. It takes as mandatory input the parameter of “Name”, which accepts the template types: “Group.Unified”, “Group.Unified.Guest”, “Application”, “Custom Policy Settings”, “Password Rule Settings”, “Prohibited Names Settings”, and “Prohibited Names Restricted Settings”. Then, it dynamically creates the parameter types associated with the specified template. Below is an example:

Then, I added the Get-AzureADDirectorySetting function with the same parameter, “Name”. This now gets the values, if set, related to that template. It also modifies the output of the GroupCreationAllowedGroupId, changing its name to GroupCreationAllowedGroup and its value is now the DisplayName rather than the ObjectId:

There is plenty of opportunity for cleanup, with the metadata comments simply being templates.

Roadmap

I plan to probably rewrite this again utilizing the xMSGraph.PowerShell module that I have released when it is finally capable of writing values rather than just reading them. The intent with this will be to eliminate the dependency on the AzureADPreview module, which is the last remaining grip that this module can solve.

Code

xAzureAD.DirectorySetting.psd1

xAzureAD.DirectorySetting.psm1