Invoke PowerShell with ActiveDirectory module not working

Ok, that’s strange. Have you tested to add “Set-ExecutionPolicy” to your ps1-file?

E.g.

test1.ps4:

Set-ExecutionPolicy Unrestricted -Scope CurrentUser
get-ADUser -filter {employeeid -eq 0000} -Properties * | select employeeid, mail | Export-Csv C:\Test\output.csv -NoTypeInformation
2 Likes