AD single-value custom attribute returning as multi-valued in powershell

别说谁变了你拦得住时间么 提交于 2020-05-17 08:44:05

问题


I have created several custom attributes in a test AD environment. Each is a single-valued unicode string that I have added to the user class. The first attribute I created works as expected. When I use get-ADuser -property CusAttribute1 I get back an object with type string. Every other custom attribute I have created I get back an object with type Microsoft.ActiveDirectory.Management.ADPropertyValueCollection.

Domain functional level 2008R2. I am able to extract the array to a string value in the select statement, but I don't understand why two attributes that were created in the same way are performing differently, and I don't want to have to extract the value from the array if I don't have to.

Get-ADuser someUser -Properties cusAttribute1,cusAttribute2 |gm

The expected result would be that cusAttribute 1 and 2 would have a type of String, but instead cusAttribute1 has a type of String and cusAttribute2 has a type of Microsoft.ActiveDirectory.Management.ADPropertyValueCollection and is an array with one value in it.

来源:https://stackoverflow.com/questions/56795088/ad-single-value-custom-attribute-returning-as-multi-valued-in-powershell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!