Solved

Custom attributes in Exchange

Posted on 2016-11-21
8
72 Views
Last Modified: 2016-11-26
I need to create 3 custom attributes for all Exchange users.  (computer name, 2 yes/no attributes) .  What is the process (i.e. script) to get the PowerShell manage that?
0
Comment
Question by:Vidia Poleon
  • 3
  • 3
8 Comments
 
LVL 15

Expert Comment

by:Jason Crawford
ID: 41896051
Simple one liner should do.  Here is a command that will set CustomAttribute1 to whatever you specify for all mailboxes:

Get-Mailbox | Set-Mailbox <identity> -CustomAttribute1 'enter text'

Open in new window

1
 
LVL 69

Expert Comment

by:Qlemo
ID: 41896216
Where do you get the values for each custom attribute from? Should they be set up identically for all users, or come from a CSV file, or ...?

For testing, almost all changing cmdlets allow for a -WhatIf parameter switch which will prevent changes from being applied. Instead, basic validation of parameter syntax and allowed values is performed only, and then a debug message sent to the console telling something about the operation and object it would be applied to.
0
 

Author Comment

by:Vidia Poleon
ID: 41901041
CSV file. What is the Syntax.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 69

Expert Comment

by:Qlemo
ID: 41901806
So you want to match a name in the CSV file, and apply the changes as noted in the same CSV line to the three fixed attributes of that member? What if the member is not found, or those members not contained in the CSV file?

In general you would do this:
Import-CSV C:\Temp\EE\CustomAttribs.csv |
  % {
    Set-Mailbox -Identity $_.ID -CustomAttribute1 $_.Attr1 -CustomAttribute2 $_.Attr2 -CustomAttribute3 $_.Attr3 -ea Continue
  }

Open in new window

with a CSV file looking like so:
ID,Att1,Att2,Att3
Qlemo,QlemoPC,Yes,No
VidiaPoleon,VPPC,No,No

Open in new window

The first line determines the column names used in our code, but are otherwise arbitrary (if changed accordingly in the code).
You can use the display name, mail address, AD account name (and other, less common forms) for ID.
1
 

Author Comment

by:Vidia Poleon
ID: 41902070
Thank you for the quick response. I am unprepared for what happens if a name is not found.
0
 
LVL 69

Accepted Solution

by:
Qlemo earned 500 total points
ID: 41902163
The script as-is will just spit out an error message and continue with the next user if that happens.
0
 

Author Closing Comment

by:Vidia Poleon
ID: 41902397
Thank you sooo much.  I appreciate the help. Well done.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question