Link to home
Start Free TrialLog in
Avatar of AL_XResearch
AL_XResearchFlag for United Kingdom of Great Britain and Northern Ireland

asked on

PowerShell script won't run as part of a logon script.

I have a PowerShell script which checks to ensure certain backups have taken place. The script checks the date of certain flag / semaphore files and shows a message if the files are too old (which one is in this test)

This works fine when manually run from the following batch file
Powershell.exe -executionpolicy Bypass -File  "Check-If-Backup-Failed.ps1"

Open in new window

but not when the same command line is added to the 'logon.bat' logon script.

What am I doing wrong (I presume it is permissions somehow) ?

NOTE: I don't get an error when I login - it just does nothing.
ASKER CERTIFIED SOLUTION
Avatar of Shreedhar Ette
Shreedhar Ette
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AL_XResearch

ASKER

Thank you for spotting my stupid and idiotic mistake ! How could I have missed that ?

Cheers.