weird logging behaviour

hi all

I make use of this logging function script write-log and this is working like a charm.
since the logging is part of an offboarding script I call several separate ps files to do different jobs.

basically I start in a checks script and within this checks script I call offboarding AD for example

in this offboarding AD I use the write-log message that says offboarding for $user.samaccountname in progress

when I run it in this sequence I get as result in my logging

VERBOSE: beginning with the offboarding process for @{SamAccountName=mactest; email=mactest@mydomain.com; UserPrincipalName=mactest@mydomain.com}.samAccountname
when I use the write-log function directly in the offboarding AD script I get as expected “beginning offboarding process for mactest”

how can I get the same result as when I call the write-log function from the offboarding AD script.

thanks for your assistance
Paul

try $($user.samaccountname)

that will give you only the contents of the samaccountname vs the entire object

Hi David I tried that as well but no such luck

You should share the relvant code. Otherwise we have to guess and that’s usually a very bad idea. :wink: