ADmodcmd custom attributes

The -custom switch allows you to name the attribute you wish to modify. This operation is only supported against attributes of the following types:
Boolean, Case Insensitive String, Distinguished Name, DN Binary, IA5-String, Integer, Numerical String, Unicode String.

Syntax: 
      [-custom attributeName attributeValue [-multi] | [-remove] ]

Key

   attributeName   The name of the attribute you wish to modify.

   attributeValue  The value to give the attribute.

   -multi (optional)
                   Specify a multi-valued append. If the attribute being modified
                   is multi-valued this switch needs to be used.
                   Otherwise, the value will be overwritten, not appended.

   -remove (optional)
                   Specify a multi-valued remove. If the attribute being modified
                   is multi-valued and -remove is used, then only the specified
                   value will get removed.

Variables

Variable usage is allowed when building attributes. Variables can be based on almost any current Active Directory attribute, as long as it has a value. Variables are seperated from literal values using the % sign. Variables must also be enclosed within a pair of single ticks (').

This example shows how to set homeDirectory to the path c:\test\username, where username is the users sAMAccountName:

-custom homeDirectory c:\test\%'sAMAccountName'%

It is also possible to pull only a specified number of characters from the attribute as well. Just specify the number of characters you want to use after the %, and before the ' The following example shows how to add an SMTP address of FirstInitial.LastName@example.com:

-addsmtp %1'givenName'%.%'sn'%@example.com


If a % or ' is needed as a literal value, prefix it with a forward slash (/) as an escape character.

Examples

Set the description attribute:

-custom description "IT Department"

Display: This is a percent sign: %

This is a percent sign: /%

If you need a literal forward slash before the percentage or single tick characters, usually when the forward slash needs to be followed by a variable. The syntax for this is //% or //'
An example would be adding an MS Mail address:

ms:PO/SERVER//%'mailNickName'

“Seek not every quality in one individual ” ~ Confucius

Related commands

ADmodcmd - Active Directory Bulk Modify Tool.
Terminal Server AttributesExchange Related AttributesMailbox RightsUser Account Settings


 
Copyright © 1999-2024 SS64.com
Some rights reserved