When I was developing the code to define an initial password for new accounts that were due to be provisioned, I needed a way of seeing the password string that was generated.
I found it quite difficult to pick through the documentation around the subject (logging) in order to get this working, so have provided a generic example below.
I ended up using the logging dll throughout the project, to record certain anomalies.
The log will be written to the MAData folder of the MA that the code resides in. The documentation states that the file location can be changed, but I never got it to work. I’m happy with the default it is written to anyway.
Note that you need to add the logging dll to the project before you make use of it: