Solved

Custom attributes in Exchange

Posted on 2016-11-21
8
37 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 14

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 68

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
The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

 
LVL 68

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 68

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now