You can run the ONDL tool from the command line with any combination of the following switches, and an alias name. Following is typical syntax usage for the ONDL tool.
ONDL [/A] [/H | /?] [/M] [/Q] [/S] [/V] AliasName
Syntax | Description |
/A | Modifier switch. If used, output includes only the alias name of any recipients displayed. Default format is: AliasName, DisplayName. |
/H | /? | Displays the Help screen. |
/M | Modifier switch. If used, AliasName is interpreted to be a message recipient, and all of the DLs that AliasName is a member of are displayed. |
/P | Profile Use MAPI profile with the name "Profile." If the profile name contains spaces, it must be enclosed in double quotes. |
/Q | Quiet mode. Informational headers and footers are suppressed. Only member or member of output is displayed. |
/R | Recursively expands membership list of nested DLs. This switch is ignored if used with output modifier switches /A, /M, or /S. |
/S | Alias stream mode. Output is a continuous stream of semi-colon delimited alias names. Implies /A switch behavior. |
/U | Use different MAPI profile. Do not piggy-back on an existing session, but instead prompt for a profile to use. |
/V | Verbose output. Displays all diagnostic output. |
AliasName | The target alias name for the DS query. Normally considered to be the alias name of the distribution list whose membership is to be displayed. Behavior is changed by use of the /M switch. |
Searches are performed only against a Microsoft Exchange Server global address list (GAL). Personal Address Book (PAB) searches are not supported. The ONDL tool piggy-backs on the existing MAPI session, if one has already been established. Otherwise, the standard MAPI logon prompt is displayed.
Normal output is sent to stdout (standard output), with error messages going to stderr (standard error).
Below are examples of ONDL syntax and output:
ONDL dlalias
Displays the members of the distribution list "dlalias" in "AliasName, DisplayName" format.
ONDL /Q dlalias
Quiet mode. Same as above, but suppresses the display of the informational header and footer text. Useful when you just want member/member of data.
ONDL /M myalias
Displays the distribution lists that "myalias" is a member of in "AliasName, DisplayName" format.
ONDL /A dlalias
Displays only the AliasName of members of the distribution list "dlalias," one to a line.
ONDL /S /M myalias
Produces a stream of semi-colon delimited AliasNames that are distribution lists that "myalias" is a member of. This output is suitable for copying to the Windows Clipboard and pasting to the To: line of a message. However, if you copy the text directly from the command prompt window, the Clipboard manager (on Windows NT 3.51) inserts end-of-line carriage returns where there are none. So when you paste to the To: line, you must remove any inserted line breaks. You can avoid this problem by redirecting output to a file and then using a text editor such as Notepad to copy and paste the output.