Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Custom attributes in Exchange

Posted on 2016-11-21
8
Medium Priority
?
85 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 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
To show how to generate a certificate request 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 >> Certificates…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

660 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