Hi
I have a script to email users when passwords are about to expire. I have entered the values for the variables in the script but when I run the script it still prompts me to enter the values. Some the script -
param(
# $smtpServer Enter Your SMTP Server Hostname or IP Address
[Parameter(Mandatory=$True,Position=0)]
[ValidateNotNull()]
[string]$smtpServer = "myemailserver.mydomain.com",
# Notify Users if Expiry Less than X Days
[Parameter(Mandatory=$True,Position=1)]
[ValidateNotNull()]
[int]$expireInDays = 10,
# From Address, eg "IT Support <support@domain.com>"
[Parameter(Mandatory=$True,Position=2)]
[ValidateNotNull()]
[string]$from="it@mydomain.com",
So for $smtpServer, $expireInDays and $from it asks for values. Why is it not reading the values stated?
Many thanks