Powershell: Use PS to email results
-
In this case we have the following variables:
$domain
$defaultPassword
$firstname
$lastname
$alias
$teamgroup1
$teamgroup2
What I would like to end up with:
to: person
cc: person1, person2
Subject:
Body:
$firstname $last name has new email of $firstname + $lastname @ $domain
Alias of $alias + $domain
Password: $Defaultpassword
Group: teamgroup1-Regards
-
@nerdydad said in Powershell: Use PS to email results:
Hope that helps.
Really? I thought your reply was meant not to help.
-
-
@nerdydad said in Powershell: Use PS to email results:
https://mangolassi.it/topic/13325/creating-a-new-user-with-o365-with-powershell
Thanks - I'll have to see about working through that and seeing what I can merge into the script I have.
-
I use a PS script I found on to email users when passwords are expiring.
I would link to it but not allowed.
-
@jaredbusch said in Powershell: Use PS to email results:
I use a PS script I found on to email users when passwords are expiring.
I would link to it but not allowed.
Sorry that this is such a PITA!! But not my doing.
-
@jaredbusch said in Powershell: Use PS to email results:
I use a PS script I found on to email users when passwords are expiring.
I would link to it but not allowed.
I have one from somewhere else let me see if I can find it. Here it is: https://www.serveradventures.com/the-adventures/send-pwdnotification-powershell-script-to-notify-users-of-password-expiration
-
@jaredbusch said in Powershell: Use PS to email results:
I use a PS script I found on to email users when passwords are expiring.
I would link to it but not allowed.
Why don't you just copy and paste the script over here?
Its your knowledge. Who's to say that YOU can't share it in both places?
Sorry. Saw that important word there "found". I rest my case.
-
@nerdydad said in Powershell: Use PS to email results:
@jaredbusch said in Powershell: Use PS to email results:
I use a PS script I found on to email users when passwords are expiring.
I would link to it but not allowed.
Why don't you just copy and paste the script over here?
Its your knowledge. Who's to say that YOU can't share it in both places?
Sorry. Saw that important word there "found". I rest my case.
I find a lot of stuff on pastebin.com. No issues with sharing pastebin stuff on ML.
-
@tim_g said in Powershell: Use PS to email results:
@nerdydad said in Powershell: Use PS to email results:
@jaredbusch said in Powershell: Use PS to email results:
I use a PS script I found on to email users when passwords are expiring.
I would link to it but not allowed.
Why don't you just copy and paste the script over here?
Its your knowledge. Who's to say that YOU can't share it in both places?
Sorry. Saw that important word there "found". I rest my case.
I find a lot of stuff on pastebin.com. No issues with sharing pastebin stuff on ML.
Interesting.
-
I can't remember where is nabbed it from, but I use the following:
Function Mailer { $emailTo = "" $emailFrom = "" $subject="It's broken, damn it" $smtpserver="" $smtp=new-object System.Net.Mail.SmtpClient($smtpServer) $Message = @" Insert a useful/meaningful message here. "@ } Mailer
Last line calls the function (duh for you, but a visitor here might not know).