Solved

Custom attributes in Exchange

Posted on 2016-11-21
8
79 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 70

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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 70

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 70

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

IoT Devices - Fast, Cheap or Secure…Pick Two

The IoT market is growing at a rapid pace and manufacturers are under pressure to quickly provide new products. Can you be sure that your devices do what they're supposed to do, while still being secure?

Question has a verified solution.

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

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
how to add IIS SMTP to handle application/Scanner relays into office 365.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses

635 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