I'm having trouble getting the PowerShell script to work as a scheduled task. The script fails to load the module "Write-Log". I don't understand what's wrong. The script works fine when I run it manually.
Please find my schedule confiuration on my Windows Server 2016 :
Hello,
I'm having trouble getting the PowerShell script to work as a scheduled task. The script fails to load the module "Write-Log". I don't understand what's wrong. The script works fine when I run it manually.
Please find my schedule confiuration on my Windows Server 2016 :
Program/Script : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Arguments : -ExecutionPolicy Bypass -File "D:\SyncContacts\Multi-Threaded.ps1" -CertificatePath "D:\SyncContacts\Getting Started\mycert.pfx" -CertificatePasswordPath "D:\SyncContacts\Getting Started\mypass.cred" -ClientID "xxxxxx-xxxxxx-xxxxxx-xxxxxx" -FolderName "Contacts" -LogPath "D:\SyncContacts\Logs" -ExcludeSharedMailboxContacts -ExcludeContactsWithoutPhoneNumber -MailboxList DIRECTORY -ExchangeOrg "xxxxxxxxx.onmicrosoft.com" -ModernAuth
Can you help me ?
Thanks