Scheduling SharePoint PowerShell Scripts in Windows Server 2008 R2

In order to schedule a SharePoint PowerShell script to be run on specific time in Windows Server 2008 R2, perform the following procedures.

  1. Save your PowerShell script into some folder location with .ps1 extension.
  2. Create a new task in Windows task scheduler. Specify the user account the PowerShell script to use when running.
  3. In Actions, add  new action of type “Start Program”. In the Program/Script section, provide full path of “PowerShell.exe” file. That is, “C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe”.
  4. In the Add Arguments field, it needs two arguments. One is the path to SharePoint Administration Console file and the other is the path to your PowerShell script file. This can be provided as follows:
    • -PSConsoleFile "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\psconsole.psc1" -Command " & ‘<folder path>\<your script file>.ps1’ "
  5. The “Start in” optional filed has to be provided as the folder location where your script resides if your script uses current folder for getting resources files or saving log files.
  6. Set other necessary options such as Triggers, Conditions etc. and save the task.

InfoPath Error: Current configuration settings prohibit embedding username and password in the database connection string

You may see this error when opening browser enabled InfoPath forms published into SharePoint 2010 forms libraries. The reason is, the form may have an associated data connection file (.udcx) which stores external data source connection details such as user name and password and the SharePoint farm is not configured to allow saving external data connection information in data connection files. To get rid of the error you will have to make the following changes in InfoPath Form Services settings.

Navigate to Central Admin > General Application Settings > Configure InfoPath Forms Services

Check the options “Allow embedded SQL authentication” and “Allow user form templates to use authentication information contained in data connection files” under the “Authentication to data sources” section.