Skip to content

Bug: SMTP server hardcoded as placeholder in Send-PasswordExpiryNotification.ps1 #6

@leonardokr

Description

@leonardokr

Description

Send-PasswordExpiryNotification.ps1 has the SMTP server address hardcoded as x.x.x.x (a placeholder value) at script scope. The script cannot function without manually editing the source code.

Impact

The script will fail on every execution until someone edits the $smtpServer variable directly in the source file.

Fix

Convert $smtpServer to a mandatory parameter (or a parameter with a sensible default), so users can provide it at runtime:

[Parameter(Mandatory = $true)]
[string]$SmtpServer

Other hardcoded values ($fromAddress, $defaultSearchBase, $logDirectory) should also be parameterized.

Files Affected

  • Scripts/ActiveDirectory/Send-PasswordExpiryNotification.ps1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions