# Clear 2 attributes for selected Users

**URL:** <https://forums.powershell.org/t/clear-2-attributes-for-selected-users/14922>\
**Category:** PowerShell Help\
**Created:** [September 9, 2020, 4:48pm UTC](https://forums.powershell.org/t/clear-2-attributes-for-selected-users/14922 "2020-09-09T16:48:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff-taylor](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/jeff-taylor/32/1015_2.png) [@jeff-taylor](https://forums.powershell.org/u/jeff-taylor)\
**Post date:** [September 9, 2020, 4:48pm UTC](https://forums.powershell.org/t/clear-2-attributes-for-selected-users/14922/1 "2020-09-09T16:48:22Z")

</div>

I’ve successfully gathered an inventory of Users that have a value for 2 attributes.

```
#backup current users and values -Task_a
Get-ADUser -filter {enabled -eq $true} -Properties delivContLength,submissionContLength |
Where-Object { $_.delivContLength -ne $null -or $_.submissionContLength -ne $null } |
select DistinguishedName,name,delivContLength,submissionContLength | Export-Csv .\TASK_a.csv -NoTypeInformation
```

Can this be piped into a `Set-ADUser -clear` attribute for both attributes? `Get-Member` says I’m still piping an ADUser object but I’m not sure how to pinpoint the Clear to just those 2 attributes.

something like this?

```
| Set-ADUser -Clear delivContLength,submissionContLength
```

---

<div class="post-metadata">

**Author:** ![krzydoug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/krzydoug/32/1008_2.png) [@krzydoug](https://forums.powershell.org/u/krzydoug)\
**Post date:** [September 9, 2020, 8:10pm UTC](https://forums.powershell.org/t/clear-2-attributes-for-selected-users/14922/2 "2020-09-09T20:10:46Z")

</div>

Yes, exactly like that.

```
Set-ADUser -Clear delivContLength,submissionContLength
```

Please use the pre /pre tags when posting code or errors. The pinned post at the top of the forum has specifics on how to format your question/code.

Thanks

---

<div class="post-metadata">

**Author:** ![jeff-taylor](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/jeff-taylor/32/1015_2.png) [@jeff-taylor](https://forums.powershell.org/u/jeff-taylor)\
**Post date:** [September 10, 2020, 1:45pm UTC](https://forums.powershell.org/t/clear-2-attributes-for-selected-users/14922/3 "2020-09-10T13:45:54Z")

</div>

Doug, thanks, will do

---

<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:28pm UTC](https://forums.powershell.org/t/clear-2-attributes-for-selected-users/14922/4 "2024-05-16T20:28:54Z")

</div>


