Apg generates random passwords.
Here are the options I use & recommend --Delimiter 08:35, 15 September 2008 (PDT)
apg -a1 -n 10 -m 8 -x 8 -M NL
This example is a bit closer to what Active Directory requires (out-of-box policy) and removes the troublesome characters that look too similar causing confusion.
apg -a1 -n 10 -m 8 -x 8 -M CNL -E Iil10oO