0
0
PowerShellscripting~20 mins

Monitoring scripts with email alerts in PowerShell - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
PowerShell Email Alert Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
PowerShell Email Alert Command Output
What is the output of this PowerShell command that sends an email alert when disk space is low?
PowerShell
Send-MailMessage -From "alert@company.com" -To "admin@company.com" -Subject "Disk Space Low" -Body "Drive C: is below 10% free space." -SmtpServer "smtp.company.com"
AThe command outputs the disk space percentage to the console.
BThe command saves the alert message to a local file instead of sending an email.
CThe command returns an error: Send-MailMessage : The SMTP server was not found.
DAn email is sent to admin@company.com with the subject 'Disk Space Low'.
Attempts:
2 left
💡 Hint
Check what Send-MailMessage does with the given parameters.
Configuration
intermediate
1:30remaining
Configuring SMTP Server for PowerShell Email Alerts
Which SMTP server configuration is correct for sending email alerts using PowerShell's Send-MailMessage cmdlet?
ASmtpServer = "smtp.company.com:8080"
BSmtpServer = "smtp.company.com"
CSmtpServer = "ftp://smtp.company.com"
DSmtpServer = "http://smtp.company.com"
Attempts:
2 left
💡 Hint
SMTP server should be specified as a hostname or IP without protocol prefix.
Troubleshoot
advanced
2:00remaining
Troubleshooting PowerShell Email Alert Failure
A monitoring script using Send-MailMessage fails with the error: 'The SMTP server requires a secure connection or the client was not authenticated.' What is the most likely cause?
AThe SMTP server requires credentials and SSL, but the script does not provide them.
BThe SMTP server address is incorrect.
CThe email recipient address is invalid.
DThe PowerShell version is outdated and does not support Send-MailMessage.
Attempts:
2 left
💡 Hint
Check if the script includes credentials and SSL parameters.
🔀 Workflow
advanced
2:00remaining
PowerShell Monitoring Script Workflow for Email Alerts
Which step order correctly describes a PowerShell script workflow that monitors CPU usage and sends an email alert if usage exceeds 80%?
A1,2,3,4
B2,1,3,4
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint
Think about the logical order of monitoring and alerting.
Best Practice
expert
2:30remaining
Best Practice for Secure PowerShell Email Alerts
Which practice is best to securely send email alerts from a PowerShell monitoring script?
ASend emails without authentication to avoid credential management.
BStore SMTP credentials in plain text within the script.
CUse encrypted credentials stored securely and load them at runtime.
DHardcode the SMTP server password in the script for simplicity.
Attempts:
2 left
💡 Hint
Consider security risks of storing credentials.