Hi All.
I am writing a script to send an email to a user.
I have the user login Id but I am going onto AD to get the users email address, my script does a few things and then gets the users email from AD before attempting to send them an email.
What I am noticing is that within my code, any line of code after the lines before fails to execute.
import-module ActiveDirectory$details = Get-ADUser -identity $owner -Properties * | Select Name, GiveNname, SamAccountName, EmailAddress $email_address = $details.EmailAddress $name = $details.GiveNname
Anything before the 4 lines runs fine, I can print out debug messages etc, but after these 4 lines, nothing runs.
Am I missing something here.