Link to home
Create AccountLog in
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?
ASKER CERTIFIED SOLUTION
Avatar of Jacob Durham
Jacob Durham
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Dell Admin
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?
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