First of all, this article is a little bit related to the previous article, we can get some employee properties from the domain, but these properties are not displayed in exchange, this time, you can do something to write some specific properties to the employee's "Custom Properties" in Exchange.
In real-world cases, this approach can present specific information , such as displaying a specific title for a user, whether professional or entertaining, as well as specific information to facilitate future screening and grouping.
Import-module activedirectory$adyh = "Zhangpengliang" $epm = (get-aduser-identity $adyh-properties *). EmployeeNumber set-mailbox-identity $adyh-customattribute4 $epmGet-mailbox-identity $adyh |select CustomAttribute4
The code is very small, altogether 5 lines, first this thing needs to run in the PowerShell of exchange, then we need to import the Active Directory module, then we just need to set a property, that is the employee name.
The third line is to take the employee's employee number attribute (this is a property within the domain), and then we set the value in the employee's 4th custom attribute, and the last line is displayed.
Very simple example. With the Exchange Toolbox → details template editor, you can display specific information on the client side
Similarly, loops are very well written, not described here.
In addition, if the property is extended in the schema, the creation of their own fields, the configuration will be a little more cumbersome, we introduce the array when the next time to explain
This article is from the "Nine uncle-Microsoft Private Cloud" blog, please make sure to keep this source http://jiushu.blog.51cto.com/972756/1663297
PowerShell passes custom attributes in Exchange (employee number, etc.)