I want to programmatically add Suggested Values for an ADClaimType
I can only find this command: Set-ADClaimType https://technet.microsoft.com/en-us/lib ... .630).aspx
It seems it only takes New-Object Microsoft.ActiveDirectory.Management.ADSuggestedValueEntry as argument for -SuggestedValues
Each entry seperated by a comma.
Ofcourse if I do this, I lose the current values in that collection.
So my train of thought was to load those in first, and Re-add them with the Set Cmdlet, together with the new value.
I have my Current Suggested values in an Microsoft.ActiveDirectory.Management.ADPropertyValueCollection $(Get-ADClaimType -identity "name").SuggestedValues
But how do I get those Values on the command Line seperated by a comma?
Set-ADClaimType: adding suggestions
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Set-ADClaimType: adding suggestions
I kinda solved this by casting the SuggestedValues I got from Get-ADClaimType -identity "name").SuggestedValues
from a ADPropertyValueCollection to a regular Object[] ..
Set-ADClaimType -SuggestedValues takes this regular Object[] as argument as mentioned above
Kinda strange there is no "add" functionality for that Collection?
I'm new to powershell: I've seen some @{add= syntax, but that doesn't seem to work with this.
from a ADPropertyValueCollection to a regular Object[] ..
Set-ADClaimType -SuggestedValues takes this regular Object[] as argument as mentioned above
Kinda strange there is no "add" functionality for that Collection?
I'm new to powershell: I've seen some @{add= syntax, but that doesn't seem to work with this.