I created a Exchange PowerShell script that can check LDAP and then create new mailboxes as needed. It works fine in the Exchange Management Shell (2007). I want it to auto run every few hours. I tried to add a scheduled task but it does not work. I chose "Exchange management Shell" as the type, It added as the following:
C:\WINDOWS\system32\WINDOW~2\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1'"
If I want to run a script called newbox.ps1, how do I do it?