Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Scheduling a PS1 in Active Directory module

$
0
0

I'm using task scheduler to try and run a ps1 file.  I can't get the arguments right. I've tried the following with no success:

%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -command import-module ActiveDirectory -file "C:\TEST.ps1"

%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -command "&{import-module ActiveDirectory;C:\TEST.ps1}"

powershell -command import-module ActiveDirectory -command - < c:\TEST.ps1

%systemroot%\system32\WindowsPowerShell\v1.0\powershell.exe “C:\TEST.ps1"

Anyone got any suggestions?  Thanks in advance!


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>