Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Custom attributes in Exchange

Posted on 2016-11-21
8
Medium Priority
?
89 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 16

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 71

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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 71

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 71

Accepted Solution

by:
Qlemo earned 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Stellar Exchange Toolkit: this 5 in 1 toolkit comes loaded with mega-software tool. Here’s an introduction to tools’ usage and advantages:
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

971 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