I advise against it. But if you must use a logon script to authenticate, here's how to get it done with PowerShell. In my PowerShell training classes or at conferences I inevitably face the question ...
Results that may be inaccessible to you are currently showing.
Hide inaccessible results