# Microsoft.ActiveDirectory.Management.ADPropertyValueCollection

**URL:** <https://forums.powershell.org/t/microsoft-activedirectory-management-adpropertyvaluecollection/17281>\
**Category:** PowerShell Help\
**Created:** [August 11, 2021, 10:27am UTC](https://forums.powershell.org/t/microsoft-activedirectory-management-adpropertyvaluecollection/17281 "2021-08-11T10:27:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robertofalchi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/robertofalchi/32/1594_2.png) [@Robertofalchi](https://forums.powershell.org/u/Robertofalchi)\
**Post date:** [August 11, 2021, 10:27am UTC](https://forums.powershell.org/t/microsoft-activedirectory-management-adpropertyvaluecollection/17281/1 "2021-08-11T10:27:19Z")

</div>

Hi all, i have another problem.

> $listaaccounts = import-csv “E:\appoggio\Scripts\Export attributo\Listaaccountstest.txt”  
> foreach($account in $listaaccounts)  
> { Get-ADUser -identity $account.accounts -properties otherMobile,name | select otherMobile,name }

Produce this output:

otherMobile name

* * *

{+393474174923} Atzei, Antonello (Portovesme - IT)  
{+393485735339} Annalisa Atzeni  
And this is ok.  
But if i try to export the output in a .txt file :

$listaaccounts = import-csv “E:\appoggio\Scripts\Export attributo\Listaaccountstest.txt”  
foreach($account in $listaaccounts)  
{Get-ADUser -identity $account.accounts -properties otherMobile,name | select otherMobile,name | select otherMobile,name | export-csv “E:\appoggio\Scripts\Export attributo\Exportcels.txt” -append

```auto
The output on the .txt file is this:
"otherMobile","name"
"Microsoft.ActiveDirectory.Management.ADPropertyValueCollection","Atzei, Antonello (Portovesme - IT)"
"Microsoft.ActiveDirectory.Management.ADPropertyValueCollection","Annalisa Atzeni".

The question is: why i get "Microsoft.ActiveDirectory.Management.ADPropertyValueCollection" in the output file ?

thankyou.
```

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [August 11, 2021, 10:48am UTC](https://forums.powershell.org/t/microsoft-activedirectory-management-adpropertyvaluecollection/17281/2 "2021-08-11T10:48:20Z")

</div>

The content of the attribute is obviously a collection - not a single value. You have to turn it into a string before you can export it. Something like this should work:

```auto
$listaaccounts = Import-Csv -Path 'E:\appoggio\Scripts\Export attributo\Listaaccountstest.txt'
$Result =
foreach($account in $listaaccounts){
    Get-ADUser -Identity $account.accounts -Properties otherMobile,name | 
    Select-Object -Property name,@{Name = 'MobileNumbers'; Expression = {($_.otherMobile) -join ';' }}
    
}
$Result |
Export-Csv -Path 'E:\appoggio\Scripts\Export attributo\Exportcels.csv' -Delimiter ',' -NoTypeInformation

```

---

<div class="post-metadata">

**Author:** ![Robertofalchi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/robertofalchi/32/1594_2.png) [@Robertofalchi](https://forums.powershell.org/u/Robertofalchi)\
**Post date:** [August 11, 2021, 11:03am UTC](https://forums.powershell.org/t/microsoft-activedirectory-management-adpropertyvaluecollection/17281/3 "2021-08-11T11:03:43Z")

</div>

Great !!!  
Thankyou Olaf.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:22pm UTC](https://forums.powershell.org/t/microsoft-activedirectory-management-adpropertyvaluecollection/17281/4 "2024-05-16T20:22:00Z")

</div>

Closed on May 16, 2024, 8:22pm UTC


