PowerShell Flashcards

1
Q

How to use credentials in Powershell?

A
$User = "username"
$Password = ConvertTo-SecureString -string "password123" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $Password
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to send email in Powershell

A

Send-MailMessage -SmtpServer “emai-smtp.eu-central-1.amazonaws.com” -Port 587 -Credential $credential -From “noreply@fleetcomplete.com” -to “xyz@fleetcomplete.com” -Subject “adasdasd” -UseSsl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly