Avatar of Dell Admin
Dell Admin
 asked on

How to empty CustomAttribute fields using Power Shell?

I need to empty the value in CustomAttribute1 and CustomAttribute2 for some Exchange 2013 mailboxes. Can you help please?
Exchange

Avatar of undefined
Last Comment
Jacob Durham

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Jacob Durham

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dell Admin

ASKER
Thanks Jacob.

I need to see who are not empty on those fields first. I found the following two commands give different result:
Get-Mailbox -Filter {CustomAttribute1 -ne $null} | select Name, CustomAttribute1, CustomAttribue2
Get-Mailbox | ? CustomAttribute1 -ne $null | select Name, CustomAttribute1, CustomAttribue2

Aren't they supposed to give the same result?
Jacob Durham

Empty

get-mailbox -ResultSize unlimited | Where-Object CustomAttribute1 -like $null

Open in new window



NotEmpty
get-mailbox -ResultSize unlimited | Where-Object CustomAttribute1 -notlike $null

Open in new window

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck