Skip to main content

Posts

Showing posts from December, 2014

Project Server to Sharepoint Email sync program

Today I got a support case where alerts in SharePoint was not triggered, I quickly realized the problem was that the email address on the users was wrong in SharePoint and the admins only updated the emails in Project Server. Why the emails were not correct i do not know and did not look further into it. To solve the difference between SharePoint and Project Server I created this small C# script/program which synchronize user emails from Project Server into SharePoint. You will typically need a tool like this when you are creating your users manually in Project Server and the emails are synchronized from a inconsistent Active Directory. The program can be found here: Project Server -> SharePoint Emails sync The code for the program/script is as follows: static void Main(string[] args) { string pwa = ""; string webApp = ""; if (args.Length <= 0) { WriteLine("WRONG ARGS, PWA"); return; } pwa = args

SharePoint Sites and Pages Powershell Warmup Script

Very nice little script i created to warmup all PWA pages and workspaces. Simply replace the SiteURL and the SitePages with your own values and place the code in a file named "SharePointWarmup.ps1". Run the script in Powershell or  Task Scheduler . $SiteURL = "http://intra/PWA/" $SitePages = "default.aspx", "projects.aspx", "ProjectBICenter/_layouts/15/xlviewer.aspx?id=/PWA/ProjectBICenter/Sample%20Reports/Projectum/DailyCommentsReport%20v7%20-%20PowerView.xlsx&Source=http%3A%2F%2Fintra%2FPWA%2FProjectBICenter%2FSample%2520Reports%2FForms%2FAllItems%2Easpx%3FRootFolder%3D%252FPWA%252FProjectBICenter%252FSample%2520Reports%252FProjectum%26FolderCTID%3D0x012000271EBEF22B819D4AA417BE3C68ADBA34%26View%3D%257B857402E5%252DF616%252D4DC2%252DA880%252D5CFC03D52EFA%257D", "Project%20Detail%20Pages/Project%20Information.aspx", "project%20detail%20pages/schedule.aspx", "project%20detail%20pa

Run powershell from CMD or Task Scheduler

If you want to run a Powershell script against SharePoint on a timely schedule the Windows Task Scheduler is fast an simple approach. A simple example of this could be a SharePoint warm-up script which hits a number of sites on a regular schedule. However it is maybe not as straight forward to figure out the syntax for the Powershell command as you might think. Run in CMD The first step is to verify you can run the script from a command prompt. (you might want to start the command prompt as the account that is going to run the scheduled task). 1. Click start and type CMD, press enter. 2. Paste the following command and replace the script-path with the location of you own script.     Powershell -file "C:\PathToFile\SharePointWarmupScript.ps1" 3. Press enter and see the script being executed successfully. Create Task Schedule The next step is to create the scheduled task. 1. Click start and type Task Scheduler, press enter. 2. Left click Task Scheduler a