Does this work?
If ( (Get-MailboxAutoReplyConfiguration).AutoReplyState -eq "Disabled"){
Set-MailboxAutoReplyConfiguration . . .
}
PowerShell cmdlets are usually orthogonal . . . if there's a "Set-" there's usually a "Get-".
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I had below powershell scripts is working fine. I need further help for below
How to add one more condition check ==> if the user already turn on Automatic reply, skip the action and proceed to next users.
$csv = Import-Csv "C:\drive\EnablingUsers.csv"
Foreach ($line in $csv) {
Set-MailboxAutoReplyConfiguration $line.user –AutoReplyState Scheduled –StartTime $line.startdate –EndTime $line.enddate –ExternalMessage $line.externalmessage –InternalMessage $line.internalmessage
}
Answer accepted by question author
Does this work?
If ( (Get-MailboxAutoReplyConfiguration).AutoReplyState -eq "Disabled"){
Set-MailboxAutoReplyConfiguration . . .
}
PowerShell cmdlets are usually orthogonal . . . if there's a "Set-" there's usually a "Get-".