fredag den 19. 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[0];  
   PS.Resource r = new PS.Resource();  
   r.Url = pwa + "/_vti_bin/psi/resource.asmx";  
   r.UseDefaultCredentials = true;  
   PS.ResourceDataSet resDS = r.ReadResources("", false);  
   Dictionary<string, string> resourcesEmail = new Dictionary<string, string>();  
   foreach (PS.ResourceDataSet.ResourcesRow resrow in resDS.Resources)  
   {  
     try  
     {  
       if (!resrow.IsWRES_EMAILNull())  
       {  
         resourcesEmail.Add(resrow.WRES_ACCOUNT, resrow.WRES_EMAIL);  
         WriteLine("Adding account: " + resrow.WRES_ACCOUNT + " - Email: " + resrow.WRES_EMAIL + "(Name: " + resrow.RES_NAME + ")");  
       }  
       else  
       {  
         WriteLine("Account email is null: (Name: " + resrow.RES_NAME + ")");  
       }  
     }  
     catch (Exception ex)  
     { }  
   }  
   using (SPSite siteCol = new SPSite(pwa))  
     {  
       using (SPWeb web = siteCol.OpenWeb())  
       {  
         foreach (SPUser user in web.SiteUsers)  
         {  
           try  
           {  
             WriteLine("Processing User: " + user.LoginName + " - " + user.Email);  
             if (resourcesEmail.ContainsKey(user.LoginName))  
             {  
               string email = resourcesEmail[user.LoginName];  
               if (email != user.Email)  
               {  
                 string oldemail = user.Email;  
                 user.Email = email;  
                 user.Update();  
                 WriteLine("Updating email for: " + user.Name + " (old: " + oldemail + ", new: " + email + ")");  
               }  
             } else  
             {  
               WriteLine("Account not found: " + user.LoginName);  
             }  
           }   
           catch (Exception ex)  
           {  
             WriteLine("Could not update: " + user.LoginName + ". Error: " + ex.Message + " at " + ex.StackTrace);  
           }  
         }  
       }  
     }  
 }  

fredag den 5. december 2014

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%20pages/sdc%20-%20budget.aspx"  
 Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue   
 $timeout = 240000 #=4 min   
 Add-Type -ReferencedAssemblies "System.Net" -TypeDefinition @"   
 using System.Net;   
 public class WarmupWebClient:WebClient  
 {  
   private int timeout = 60000;   
   public WarmupWebClient(int timeout) {this.timeout = timeout;}  
   protected override WebRequest GetWebRequest(System.Uri webUrl)   
   {  
     WebRequest requestResponse = base.GetWebRequest(webUrl);   
     requestResponse.Timeout = this.timeout;   
     return requestResponse;   
   }   
 }   
"@  
 function HitPage($url)  
 {  
   try   
   {   
     Write-Host "Hitting page: $url"   
     $wc = New-Object WarmupWebClient($timeout)   
     $wc.Credentials = [System.Net.CredentialCache]::DefaultCredentials   
     $ret = $wc.DownloadString($url)   
   }  
   catch [Exception]   
   {   
     Write-Host "Failed to hit page. Message was: $($_.Exception.Message)"   
   }   
 }  
 foreach ($site in $SitePages)   
 {   
   $warmupSite = $SiteURL + $site  
   HitPage($warmupSite)  
 }  
 Write-Host "All sites have been hit"   

Of cause you want this script to be run on a timely schedule so remember to check out my other post on how to do exactly that Run Powershell from Task Scheduler .

torsdag den 4. december 2014

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 and click Create Task.



 3. Give the task a name, ex. SharePoint Warmup Task.



4. Select your desired options on the Triggers tab.

5. On the Actions tab click New and type the following.
    Program/Script: Powershell
    Add arguments (optional): -file "C:\PathToFile\SharePointWarmupScript.ps1"



6. Click OK to create the task.

The scheduled Powershell task is now created and you can test it out in the Task Scheduled Library if you like.




onsdag den 26. november 2014

PWA - Every Queuejob is failing (The value's length for key 'application name' exceeds it's limit of '128', ReportingResourceChangeMessageFailed, ProjectPublishFailure)

Today I came across a very strange problem. On a newly install server every queue job was failing. Project Create, Resource Change, Workflow submit, every reporting job and some project job was failing.

Problem:

I started looking into the queue to find an explanation. Here I found several errors, but could not make any sense of them.
Resource Reporting Error:
 Generelt•Reporting message processor failed:◦ReportingResourceChangeMessageFailed (24008) - The value's length for key 'application name' exceeds it's limit of '128'.. Detaljer: id='24008' name='ReportingResourceChangeMessageFailed' uid='3f02fa38-f574-e411-93fd-00155d007817' QueueMessageBody='Resource UID: 'dc548543-3352-454e-a86b-96d1a4bf63d2'. ChangeType='Alter'. ResourceChangeType='All'' Error='The value's length for key 'application name' exceeds it's limit of '128'.'.   
 ◦ReportingResourceChangeMessageFailed (24008) - The value's length for key 'application name' exceeds it's limit of '128'.. Detaljer: id='24008' name='ReportingResourceChangeMessageFailed' uid='4102fa38-f574-e411-93fd-00155d007817' QueueMessageBody='Resource UID: 'dc548543-3352-454e-a86b-96d1a4bf63d2'. ChangeType='Alter'. ResourceChangeType='All'' Error='The value's length for key 'application name' exceeds it's limit of '128'.'.   
 ◦ReportingResourceChangeMessageFailed (24008) - The value's length ...........  
   
   

Project Create Error:
 Generelt•Microsoft.Office.Project.Server.BusinessLayer.Queue.Message:◦ProjectPublishFailure (23000). Detaljer: id='23000' name='ProjectPublishFailure' uid='e42751bd-f874-e411-93fd-00155d007817' projectuid='99d8e3b1-f574-e411-93fd-00155d007817' messagetype='Microsoft.Office.Project.Server.BusinessLayer.QueueMsg.UpdatePublishStaleFlagMessage' messageID='32' stage='MSP_UPDATE_PUBLISH_STALE_FLAGS' blocking='Block'.   
   
 •Queue:◦GeneralQueueJobFailed (26000) - ProjectPublish.UpdatePublishStaleFlagMessage. Detaljer: id='26000' name='GeneralQueueJobFailed' uid='e52751bd-f874-e411-93fd-00155d007817' JobUID='a7d8e3b1-f574-e411-93fd-00155d007817' ComputerName='dbe6713d-1f94-451a-8426-16547c0b512f' GroupType='ProjectPublish' MessageType='UpdatePublishStaleFlagMessage' MessageId='32' Stage='MSP_UPDATE_PUBLISH_STALE_FLAGS' CorrelationUID='48b5cf9c-a9b3-8036-b512-f107af415cb9'. Der er flere oplysninger i ULS-logfilerne på computeren dbe6713d-1f94-451a-8426-16547c0b512f for poster med Job-UID a7d8e3b1-f574-e411-93fd-00155d007817.   

Also in the ULS logs I notice the following two lines:

 System.ArgumentException: The value's length for key 'application name' exceeds it's limit of '128'.   at System.Data.SqlClient.SqlConnectionString.ValidateValueLength(String value, Int32 limit, String key)   at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)   at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)   at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)   at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)   at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)   at System.Data.SqlClient.SqlConnection..ctor(String connectionString, SqlCredential credential)   at Microsoft.Office.Project.Server.Data.SqlSession.OpenConnection()   at Microsoft.Office.Project.Server.Data.TransactionalSqlSession.RetrySqlConnectionInitialization(Action`1 initializer)   at Microsoft.Office.Project.Server.Data.TransactionalSqlSession.OpenConnection()   at Microsoft.Office.Project.Server.Data.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock).....  
   
 SqlCommand: '--Handle Update Using Sproc : MSP_Epm_UpdateWorkflowPhase SELECT @bp0 AS SQLBatchRequestColumnName; EXEC [dbo].MSP_Epm_UpdateWorkflowPhase @PhaseUID, @PhaseName, @PhaseDescription; '   CommandType: Text CommandTimeout: 30   Parameter: '@bp0' Type: UniqueIdentifier Size: 0 Direction: Input Value: 'cea2a731-f674-e411-93fd-00155d007817'   Parameter: '@PhaseUID' Type: UniqueIdentifier Size: 0 Direction: Input Value: 'caf3b122-9bc8-4f46-96b0-18976722ad9e'   Parameter: '@PhaseName' Type: NVarChar Size: 255 Direction: Input Value: 'Analyse'   Parameter: '@PhaseDescription' Type: NVarChar Size: 1000 Direction: Input Value: 'Opstarten af projektet hvor Start stage udføres'  

Solution:

The problem is apparently a new issue in SQL Server 2012. There is a limitation of 128 characters in the connection string and the problem only manifests itself when the queue starts to process jobs.
To solve the problem I simply renamed the Project Server database to something much shorter (SPDEV_PWA):


Of cause you also have to do a reprovisioning of the PWA instance after you rename the database. Otherwise Project Server will not be able to find your server.

On a site note: many SQL blogs suggested the file path to the database file (.mdf) was too long. I tried to move the database to the root of my E:\ drive but it did not solve the problem.



tirsdag den 25. november 2014

PowerShell results size unlimited/truncated - $FormatEnumerationLimit/Width

Ever experienced the problem where you run a Powershell command and you cannot see the whole result because the result is truncated.

Problem:

If you for example run the Test-SPsite command you might see something like the following:


 Site        : SPSite Url=http://atlas/pwa  
 Results      : {  
            SPSiteHealthResult Status=Passed RuleName="Conflicting Content Types" RuleId=befe203b-a8c0-48c2-b5f0-27c10f9e1622,   
            SPSiteHealthResult Status=FailedWarning RuleName="Customized Files" RuleId=cd839b0d-9707-4950-8fac-f306cb920f6c,   
            SPSiteHealthResult Status=Passed RuleName="Missing Galleries" RuleId=ee967197-ccbe-4c00-88e4-e6fab81145e1,   
            SPSiteHealthResult Status=Passed RuleName="Missing Parent Content Types" RuleId=a9a6769f-7289-4b9f-ae7f-5db4b997d284,   
            SPSiteHealthResult Status=FailedError RuleName="Missing Site Templates" RuleId=5258ccf5-e7d6-4df7-b8ae-12fcc0513ebd,   
            SPSiteHealthResult Status=Passed RuleName="Unsupported Language Pack References" RuleId=99c946f7-5751-417c-89d3-b9c8bb2d1f66,   
            ...}  
 PassedCount    : 5  
 FailedWarningCount : 1  
 FailedErrorCount  : 1  

Here you will see ... at the end of the Results column indicating there is more content but it is not shown.

According to the documentation (http://technet.microsoft.com/en-us/library/dd347677.aspx) the solution is simply to provide the Width parameter. However i have not found a version of Powershell that actually does what the documentation says.

Solution:

The solution/workaround is to set the FormatEnumerationLimit parameter. Run the following command to set the limit to 20 lines.

 $FormatEnumerationLimit = 20  

You can also set the limit to -1 to get all lines returned. This can cause problems if the number of lines is more then 100.
The result of Test-SPSite now contains all lines.

 Site        : SPSite Url=http://atlas/pwa  
 Results      : {  
            SPSiteHealthResult Status=Passed RuleName="Conflicting Content Types" RuleId=befe203b-a8c0-48c2-b5f0-27c10f9e1622,   
            SPSiteHealthResult Status=FailedWarning RuleName="Customized Files" RuleId=cd839b0d-9707-4950-8fac-f306cb920f6c,   
            SPSiteHealthResult Status=Passed RuleName="Missing Galleries" RuleId=ee967197-ccbe-4c00-88e4-e6fab81145e1,   
            SPSiteHealthResult Status=Passed RuleName="Missing Parent Content Types" RuleId=a9a6769f-7289-4b9f-ae7f-5db4b997d284,   
            SPSiteHealthResult Status=Passed RuleName="Missing Site Templates" RuleId=5258ccf5-e7d6-4df7-b8ae-12fcc0513ebd,   
            SPSiteHealthResult Status=Passed RuleName="Unsupported Language Pack References" RuleId=99c946f7-5751-417c-89d3-b9c8bb2d1f66,   
            SPSiteHealthResult Status=Passed RuleName="Unsupported MUI References" RuleId=6da06aab-c539-4e0d-b111-b1da4408859a}  
 PassedCount    : 6  
 FailedWarningCount : 1  
 FailedErrorCount  : 0  

mandag den 24. november 2014

SharePoint 2013 Keeps Prompting For Credentials (DisableLoopbackCheck - BackConnectionHostNames - Logon Failure 401.1 - Access Denied )

Problem:

When you access a SharePoint site collection, it keeps on prompting for authentication and eventually give you an Access Denied error.


Reason:

This is a feature that prevents access to a web application using a fully qualified domain name (FQDN) if an attempt to access it takes place from a machine that hosts that application. The end result is a 401.1 Access Denied from the web server and a logon failure in the event log.


Solution:

There are 2 ways to solve this, (1) the correct way and (2) the fast and easy way.

1 - The correct way (test/production servers)
Specify the host names that needs to do loop back check in the registry – BackConnectionHostNames. This is the correct way and is more secure. http://support.microsoft.com/kb/896861
 - Open regedit.exe
 - Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
 - Create a new multi-string value and name it "BackConnectionHostNames"
 - Type the host name of site that are referencing on the local server 
   (multiple host names must be separated by a newline)
 - Click OK and close regedit
 - You should no longer get the 401.1 Access Denied message (you may also need to restart the IISAdmin service)

1 - The easy way (development servers)
Disable the loopback check (DisableLoopbackCheck) altogether. This puts your server in a security risk. http://support.microsoft.com/kb/896861
 - Open regedit.exe
 - Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
 - Create a new d-word (32-bit) and name it "DisableLoopbackCheck"
 - Edit the d-word and give it a value of 1
 - Click OK and close regedit
 - You should no longer get the 401.1 Access Denied message (you may also need to restart the IISAdmin service)



Additional info:

The event view might also give the following error.
Event Type: Failure Audit
Event Source: Security
Event Category: Logon/Logoff
Event ID: 537
Date: Date
Time: Time
User: NT AUTHORITY\SYSTEM
Computer: Computer_Name
Description: Logon Failure:
Reason: An error occurred during logon
User Name: User_Name
Domain: Domain_Name
Logon Type: 3
Logon Process: Ðùº
Authentication Package: NTLM
Workstation Name: Computer_Name
Status code: 0xC000006D
Substatus code: 0x0
Caller User Name: -
Caller Domain: -
Caller Logon ID: -
Caller Process ID: -
Transited Services: -
Source Network Address: IP_Address
Source Port: Port_Number

lørdag den 15. november 2014

SharePoint 2013 : Cannot connect to the targeted site.

On my Contoso environment I was trying to create a sandboxed solution. I have already configured my app domain and app management services. But when I tried to validate the site I got the following error message.

Error



 Cannot connect to the targeted site. This error can occur if the specified site is not hosted on the local system. SharePoint solutions work only with locally-installed versions of SharePoint Foundation or SharePoint Server. Remote development is supported only for apps for SharePoint 2013.  

If you search around the internet you will find many people suggesting to change your host file from 127.0.0.1 to the actual IP.

Solution

However the solution, at least on a Contoso environment, is to type in the actual IP address in the host file.
(the IP 192.168.150.1 is the special IP for Contoso, I have 2 network adapters)

And do not forget to clear/flush the DNS cache.
Now the solution can be created and validates.


fredag den 14. november 2014

Visual Studio 2013 Update 4 Release Notes (SharePoint notes)

A new update to Visual Studio 2013 is out, and as always there are a lot of general improvements and some improvements targeted SharePoint/Project Server.

The most noticeable changes for SharePoint development (and SharePoint App development) is:
 - Better IntelliSense for JavaScript
 - JSON improvements (Loading and IntelliSense)
 - Better HTML IntelliSense
 - #Region support in HTML
 - Razor bugfix
 - XAML Designer bugfix (Silverlight)


(Download it from: http://support.microsoft.com/kb/2994375)

Complete release notes



Team Foundation Server

  • You can create trend charts and aggregate data from work item queries. When a new work item chart is created, you can see three new chart types: Stacked Area, Area, and Line.
  • You can move items in the backlog to the top position (Move to Top) or to any position you want to determine (Move to Position).
  • You can enter the "full-screen mode" for all the pages in the Backlogs hub.
  • You can search for an Area path in Web Access.
  • You can use Pull Requests to help review and merge your code in Git repositories.
  • Web Access can return directly to query results from a detailed view of the query by using a toolbar command, or the keyboard shortcut ALT + Q.
  • Web Access can generate an email directly from the work item view by using a new toolbar command.
  • Web Access has an option to view query results full-screen.
  • With the free Stakeholder License, Stakeholders can view the backlog, edit items, run work item queries, and many other operations.
  • Agile teams can have up to 999 work items in the first or last column of the Kanban board.
  • Web Access now has the option to open a work item in a new window or tab.
  • You can maximize rich text fields for quick readability.
  • Query results can now be copied as HTML for a better copy/paste experience.
  • In work item tracking HTML fields, you can now use Ctrl + Click to open a hyperlink URL in a new window.
  • You can configure backlogs to include or exclude bugs.
  • Product backlog items can now be assigned to iterations even in hierarchical views such as Features to Stories and Stories to Tasks.
  • When you are linking work items, you can find the target work items by running an existing query or based on text in the title.

Visual C++

  • Visual Studio now scans or rescans a solution and then updates the database much more quickly for large solutions. Therefore, the browsing process should be much more responsive, and you should experience fewer situations in which you are blocked when you perform browsing operations (such as Go To Definition) on large solutions.
  • Visual Studio 2013 Update 4 enables you to collect and analyze GPU usage data for Windows applications by using the Performance and Diagnostics hub. This tool can help you determine whether CPU or GPU is the performance bottleneck of the application. You can also inspect timing data of each GPU event if supported graphics cards are present and the latest drivers are installed.

JavaScript Editor

  • When you use the RequireJS JavaScript library, IntelliSense can be shown for your module dependencies.

CodeLens

  • The size of CodeLens data that is stored in a Team Foundation Server database was reduced by removing duplicated information and reformatting.
  • Only changes in the last 12 months are used to calculate CodeLens Team Indicators. You can change this duration by using TFSConfig CodeIndex /indexHistoryPeriod command.
  • You can see the period for which CodeLens data is shown on the tooltip and in the details. You can also view the full file history from CodeLens details. Therefore, you will use less network resources for CodeLens because the data is now compressed.
  • When CodeLens temporary data size increases beyond a certain limit in your Team Foundation Server database, processing of past changes will be paused. Processing will restart automatically after temporary data is cleaned up. You can configure this size limit by using TFSConfig CodeIndex /temporaryDataSizeLimit command.

Testing Tools

  • Associated Test Suites pane shows all test suites that contain a given test case. The list of test suites is scoped for all test plans across all team projects.
  • Recent Test Results pane shows the recent test results associated with a test case for all configurations, test suites, and test plans.
  • You can create snapshot or trend charts with test case fields to track test authoring activity. You can create snapshot charts with test results fields to track test execution activity.
  • You can view and filter tests by tags in the Test Hub and bulk edit tags of test case in the gird view.

ASP.NET and Web platform

  • Microsoft ASP.NET and Web Tools 2013.4 RTM
    • JSON Editor improvement

      We have made some improvements in JSON editor, including performance improvements such as loading JSON schema asynchronously, caching of the child schemas, and supporting better IntelliSense. Additionally, there are the following new features:
      • JSON Schema validation Add JSON schema validation feature, based on the schema that is defined in the schema drop-down list.
      • Un-minify context menu You can right-click the JSON editor and select Un-minify context menu to un-minify any long arrays in the JSON file.
      • Reload Schemas context menu Visual Studio will cache the schema that is downloaded from Internet and will use the cache even after you restart Visual Studio. If you know the schema is changed, you can use the context menu Reload Schemas Ctrl+Shift+J to re-download the current used schema in the active JSON document, and then use it immediately on the current document.
      • IntelliSense for package.json and bower.json In addition to proving IntelliSense and validation for both package.json and bower.json files, Visual Studio also provides live IntelliSense for both Bower and npm packages directly in the JSON editor.
      • Duplicate property validationThe JSON editor will now provide validation for any duplicate properties. This helps catch a common problem with JSON file authoring.
    • HTML Editor

      Microsoft improved HTML editor with some software updates, updated IntelliSense for web standards, and introduced following new features:
      • Better client template formatting The HTML editor does not parse or format double-curly syntax {{…}} anymore. This is to make sure that the content of that syntax is not treated as being HTML and therefore being invalidated, nor does it try to format them, which cannot be done correctly by using the HTML formatter. This is great for Angular, Handlebars, Mustache, and other double-curly template syntaxes.
      • Support for custom elements, polymer-elements and attributes HTML Editor no longer validates unknown attributes for custom elements, because there will be many custom made tags in different frameworks. Therefore, there will no longer be squiggles under the unknown elements.
      • Basic IntelliSense for Web Components HTML Editor has IntelliSense for <link rel="import" /> that is part of the Web Components standard .
      • HTML element tooltips Tooltips are supplied for HTML elements in the editor.
      • #region support HTML editor now supports region folding. You can use surrounding snippet to enclose the current selection as well.
      • Todo/Hack comment support in Task List
      • Angular icons Both Angular directives such as <ng-view> and attributes such as ng-controller is now displayed in IntelliSense together with an Angular logo to make it easy to identify them.
      • Bootstrap icons The IntelliSense provided in HTML class attributes are now displayed together with the Bootstrap logo if the class name was defined by the Bootstrap CSS file.
    • CSS/LESS/Sass Editor
      • Todo/Hack comment support in Task List
      • @viewport fix for LESS editor In LESS editor, @viewportwill not show verification warning anymore.
      • Provide many more snippets CSS/LESS/Sass Editor now provides more snippets to ease developing experience.
    • Browser Link
      • CSS automatically synchronous Now, saving the CSS file or changing it externally (such as by using a LESS/SASS compiler) will cause the whole CSS file to reload in the browser. If the file is in a state where it cannot auto-sync, Ctrl + S will cause an automatic reload, and this should put it back into a good state without having to refresh the linked browsers (Ctrl + Alt + Enter). The feature can be disabled in the toolbar.
    • WebJobs Tooling

      Now supports controlling web jobs through server explorer WebJobs’ node inside Azure Website in the following ways:
      • WebJobs nodes underneath Website nodes in Server Explorer.
      • Start/Stop Continuous WebJobs from Server Explorer.
      • Run On-demand or Scheduled jobs from Server Explorer.
      • View WebJob Dashboard from Server Explorer.

        You can use View Dashboard context menu to go to the Azure website’s WebJob dash board.

    • WebJobs SDK
      • WebJobs SDK will be preinstalled in the Azure WebJob project templates.
  • Microsoft ASP.NET and Web ASP.NET MVC 5.2.2

    Template packages are updated to use ASP.NET MVC 5.2.2. This release has no new features or software updates in MVC. We made a change in Web Pages for a significant performance improvement, and have subsequently updated all other dependent packages we own to depend on this new version of Web Pages.
    • ASP.NET Web API 5.2.2

      In this release we have made a dependency change for Json.Net 6.0.4. For more information about what is new in this release of Json.NET, see Json.NET 6.0 Release 4 - JSON Merge, Dependency Injection . This release has no other new features or software updates in Web API. We have subsequently updated all other dependent packages we own to depend on this new version of Web API.
    • ASP.NET Web API OData 5.3.1

      See this release note for Web API OData 5.3 .
    • SignalR 2.1.2

      Template packages are updated to use SignalR 2.1.2. See its release note on GitHub .
    • Microsoft Owin 3.0

      Template packages are updated to use Microsoft Owin 3.0 NuGet packages. See this Owin 3.0 release note .
    • NuGet 2.8.3
      • Support for DevExtreme project and BizTalkProject are added to 2.8.3.
      • Check here for detailed information.

Release Management

  • Use tags when you deploy to a vNext environment

    Now, you can use tags together with the servers in your vNext Azure or standard environments. When a stage is deployed, these actions are performed on any server that contains this tag. Therefore, you have to create the set of actions only one time for multiple servers. By using vNext tags, you can also switch the deployment order from parallel to sequence.
  • Access to system variables for your deployment sequences or scripts

    By popular user demand, you can now access system variables in the same manner as other configuration variables and you can use them in your release template. You do not have to hardcode these variables any longer.
  • Reduce the need for configuration files to deploy your builds

    You can now set up configuration variables for your release at the global, server, component, and action levels. This additional flexibility means that you may no longer have to maintain configuration files together with your build.
  • Manual intervention with a vNext release path

    Now you can add manual steps to a stage in a vNext release path, and you can add a manual intervention activity to your deployment sequence. When the notification is triggered in that sequence, the deployment pauses, and then you can run some manual steps before you continue to process the rest of the automation for the release path.
  • Build drops that are stored on TFS servers

    If you have set up your build definition to copy the build output to the server and not to a UNC path, vNext components in Release Management can now use the builds that are stored on the server.
  • Deploy from a build drop by using a shared UNC path

    Now you can use release management to deploy to servers by using build drops that are located on a shared Universal Naming Convention (UNC) path. You can deploy if both the target server and the Release Management server have access to the shared UNC path.

Application Insights

  • Visual Studio 2013 Update 4 includes performance improvements and software updates for the Application Insights Tools for Visual Studio. This update is fully compatible with projects that had Application Insights added in the Visual Studio 2013 Update 3, and includes the following updates:
    • Seamless integration with the publish to an Azure website workflow.
    • Improve solution integration and project detection so that Application Insights is no longer included in unsupported projects including Python.
    • For more information about changes to Application Insights data in the Azure Preview Portal, see Start Monitoring your Application’s Heath and Usage .

Fixed issues

Team Foundation Server

  • When you set up reporting without SharePoint integration, the Network Service account is not set for the TfsWarehouseAdministrator role of the Analysis Database.
  • When an Area path is reparented, you may see empty revisions in work items.
  • You may experience notification failures if one notification initially fails.
  • The $(BuildDefinitionID) variable is case-sensitive and may cause builds to fail.
  • The addition of a new user after you make Area or Iteration Path changes could block the opening of work items in Web Access.
  • In the TfsConfig remapDBs command, a comma separator (',') may be treated as two SQL instances instead of a single SQL instance and a port number.
  • Multiple detachments of a collection could lead to incorrect data in the collection database. 
  • Assume that you associate different work item types from different projects. When you build the projects, builds may fail.
  • You cannot do a continuous integration build for a project from a Git repo if the build definition is stored in a central TFVC project.
  • Project Administrator user may be denied access to Version Control administration.
  • Some TFS upgrade scenarios may fail when you attach a collection if the same collection is attached multiple times or multiple collections that have the same membership are attached.
  • When you try to view contents from Source Control Explorer in Visual Studio, you may receive the following error message:
    TF14044: Access denied: users <> needs the AdminWorkspaces global permissions(s).
  • You cannot use source indexing feature unless you setup separate build computer or controller for each build definition.
  • You may see the w3wp process using 100 percent CPU.
  • TFS does not start if C:\Windows\System32\inetsrv\config\applicationHost.config is updated to output X-Content-Type-Options.
  • You may receive an unsupported browser message when you try to open security dialog on query or source control from Team Explorer.
  • When you experience the following scenarios, a custom build program that uses FileContainerHttpClient.UploadFileAsync will fail unless you recompile.
  • If you are trying to use the latest Git template, it may fail.
  • A shelveset that fails the CheckInGatedChanges activity at the end of the build results in a failed build that actually did check in changes. The build should be marked partially succeeded.
  • Build time for all builds increases with the number of workspaces that are used by builds.
  • A chat room administrator will receive an error message when you try to delete the event subscription for the team room unless the chat room administrator is also a Team Project Collection administrator.
  • If you create a TFS list in Excel and include an HTML field, you may lose all formatting in the HTML field.
  • When you subscribe to the Git commit event notification in team room, the hyperlink in the message may point to an error page.
  • You cannot unmap the TFS to Project Server integration if the Project Server instance is deleted or unreachable.
  • You may be unable to push repos with TFS Server when an old GIT client was used at any point in the past.
  • You may be unable to use feature enablement on some process templates.
  • Null reference Exceptions are thrown by Command Query changeset when a requested changeset does not exist.
  • You may receive an out-of-memory error message when you push repos with TFS Server.
  • You may see database growth if you have many saved builds.
  • You may receive a Null Reference error when you annotate files in the Git repository.
  • When you write code in Visual Studio, the Output window may start when you try to update SCC glyphs in Solution Explorer.
  • Occasionally Visual Studio crashes when it is working in Source Control Explorer.
  • The selected work item and scroll location do not remain when you open a work item in a query and then you return to the query results.
  • If you detach a collection database from one server and attach it to another server, some identities and groups that could not be resolved will be deleted without a warning.
  • If you upload a file that is larger than 1GB to TFS 2013, when you try to download the attachment by using Web Access, you may receive an ArithmeticException exception.
  • You cannot programmatically set checkin notes in the Pending Changes page.
  • If a plain text field is set to readonly, it is difficult to interact with it by using Internet Explorer.
  • If the MinimumSize for a plain text control is set, the control may overlap nearby controls in Web Access.
  • If you open a work item with read-only Description field that have leading or trailing spaces, you cannot save the work item or work with it.
  • When you merge CSHTML files in both Team Foundation Version Control (TFVC) and Git. The toolbar is disabled. You cannot merge CSHTML files by using the merge tool.
  • Basic license customers should be unable to turn on and off the mapping pane in the product backlog. 
  • When you open a Stories Overview Report or Stories Progress Report by using a Turkish operating system, the report crashes.

Visual C++

  • When you define an operator incorrectly, the compiler may crash.
  • When you define a static const variable in the header and then declare it in the source, the linker will treat the symbol as multiply defined incorrectly.
  • When you define a conversion operator for an undefined type, the compiler may crash.
  • Explicitly instantiating a variadic function template can cause an internal compiler error.
  • The compiler incorrectly allows for the explicit trivial constructor to be private.
  • Using nested templates can cause internal compiler errors.
  • Error C2951 can cause a subsequent internal compiler error.
  • Designated initializers may not initialize unions within structs.
  • The use of default function parameters can cause internal compiler errors.
  • Wrong arguments may be passed when you use nested uniform initialization.
  • Initializer lists can cause internal compiler errors.
  • Error C4530 can cause a subsequent internal compiler error.

Testing Tools

  • With TFS 2013 Update 3, Test Plans support custom workflow states instead of just Active and Inactive states. Because users can connect to test plans in any one of the custom states, the restriction to display only active Test Plans in Microsoft Test Manager - Test Plan selection dialog box was removed. Therefore, the Test Plan selection dialog box now displays both Active and Inactive plans. However, the lack of filter and sort capability on the State column in the Test Plan selection dialog box was a regression introduced in Visual Studio 2013 Update 3. Because of this regression, users had to browse through a long list of Active and Inactive Test Plans to select one. In Visual Studio 2013 Update 4, the sort and filter capability is fixed so that users can filter and sort on the Test Plan State column in the Test Plan selection dialog box.

ASP.NET and Web platform

  • In a Web Site project, you cannot add Razor (CSHTML/VBHTML)-based item templates unless you first install the correct Web Pages NuGet packages. This change lets you add item templates in WSPs without having to first install a package. Adding the item template will automatically install the required packages.
  • You can completely disable request validation in an application. This means that RequestValidationMode=0.0 is supported in Visual Studio.

Debugger

  • PDB files will no longer be locked when WCF debugging.
  • The Retry button for debug.assert statements now works correctly in Visual Studio Express 2013.
  • Return values will be displayed in the autos window for native debugging together with Edit and Continue enabled.
  • When you perform mixed mode debugging on an application, the application may crash.

XAML Designer

  • When you reference binaries that are incompatible with a 32-bit process in your project, the designer may crash and throw an OutOfMemory exception.

onsdag den 12. november 2014

MS Project VBA - Read Lookup Table/Custom Field


After Project Online and heavy use of the PWA-Schedule features in Project Server 2010/2013 I rarely get use for my VBA skills anymore.

However today I needed to update a lot of resources in Resource Center with a value from a lookuptable. Therefore I needed a way to loop through all the lookuptable/custom field values and use the value.

After a little digging I found a way to read out all the lookuptable values through VBA. And of cause I need to share this.

VBA to read all lookuptable values from the RBS lookuptable 

 Sub ReadRBSLookuptable()  
 'Created by Christian Holse Fanning  
 Dim lookupTableName As String  
 lookupTableName = "RBS"  
 Dim rbsLT As LookupTable  
 Dim ltValue As LookupTableEntry  
   For i = 1 To Application.GlobalOutlineCodes.Count  
     If Application.GlobalOutlineCodes(i).Name = Trim(lookupTableName) Then  
       Set rbsLT = Application.GlobalOutlineCodes(i).LookupTable  
     End If  
   Next i  
   If Not IsNull(rbsLT) And Not (rbsLT Is Nothing) Then  
     For Each ltValue In rbsLT  
       Debug.Print ltValue.FullName  
     Next ltValue  
   End If  
 End Sub  


Hope someone can use this.

mandag den 10. november 2014

Error occurred in deployment step 'Add Solution': Attempted to perform an unauthorized operation.

Received this error today when trying to create a SharePoint solution against a newly created site.


My first problem was the site was configured to use a port which was already used by another web site. Therefore the site could not start at all.

In my case both Default Web Site and SharePoint - 2000 was both using port 2000. Changing the port of Default Web Site and I was able to start the site.

However now I still received the same error message. When browsing the site I realized I did not have access to the site.

Giving access to my user and I was able to deploy the solution.

To sum up this post:
 - Check the site can start
 - Check the site can be browsed
 - Check your user have access to the site

onsdag den 5. november 2014

Configure DMZ for SharePoint provider hosted apps (accessing web site from internet).

If you are developing apps provider hosted apps for SharePoint (or Project Server) and want to deploy them to SharePoint Online you need to host your app's web site part somewhere. One good and obvious place is to host it on Azure, however I have found that in order to troubleshoot your app it is a lot easier if the app is hosted on a local IIS.

In order to host your app on a local IIS you need to configure the DMZ for the app (in addition to the website, certificate, app secret and app id).

Configure DMZ for a D-Link router

DMZ tells the router that you allow a specific port to go to a specific computer. In the following I will explain how to configure DMZ for my D-Link DI-524 router. Other routers will have similar approhes.

Log on to the router at IP address 192.168.0.1.
Enter the admin user name and password (default password is "password").

Click on the Advanced tab.

Choose
 - Enable
 - Your PC's IP address (the PC hosting the apps web site)
 -  The port your site is running on (4000 in my case, but it is properly port 80 in your case)

Click Apply. The entry is now located in the list.

You can now access your app's website from the internet.
Do not forget to also open the port in your firewall.

søndag den 2. november 2014

Error occurred in deployment step 'Install app for SharePoint': Sideloading of apps is not enabled on this site

If you are starting to develop Apps for SharePoint or Project Server and you encounter the problem where you get the following error message:

 Error     1     Error occurred in deployment step 'Install app for SharePoint': Sideloading of apps is not enabled on this site.             0     0     SharePointApp_01  


It is usually because the site you are developing against is not a SharePoint development site. The easiest way to solve the problem is of cause to create a new SharePoint Development site.



However this is not always possible and you might have a lot of content on your site you want to test against. Furthermore if you are creating a Project Server App I have not found a way to create a Project Server Development site.

Convert SharePoint (and Project Server) site into a Development site
This can simply be done through Powershell. To be able to run Powershell agains online you will need to download SharePoint Online Management Shell.

The Powershell script you need to run is:

 $programFiles = [environment]::getfolderpath("programfiles")  
 add-type -Path $programFiles'\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll'  
 $siteurl = 'https://MyTenant.sharepoint.com/sites/pwa'  
 $user = 'admin@MyTenant.onmimcrosoft.com'  
 $pass = ConvertTo-SecureString -String 'password123' -AsPlainText -Force  
 [Microsoft.SharePoint.Client.ClientContext]$cc = New-Object Microsoft.SharePoint.Client.ClientContext($siteurl)  
 [Microsoft.SharePoint.Client.SharePointOnlineCredentials]$spocreds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($user, $pass)  
 $cc.Credentials = $spocreds  
 $site = $cc.Site;  
 $featureDevSiteUid = new-object System.Guid "AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D"  
 $site.Features.Add($featureDevSiteUid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);  
 $cc.ExecuteQuery();  




tirsdag den 21. oktober 2014

Install DLL in GAC - Windows 2008/2012 (Using Powershell, No GacUtil.exe)

If you want to install a DLL in the GAC and do not have the GACUtil.exe available. Powershell is properly the easiest way to procede.

Before Powershell you would properly just drag the DLL file into the C:\Windows\Assembly but this option is usually not available anymore.

Powershell - Add DLL to GAC

So to install a DLL file in the GAC simply execute the below Powershell script. Remember you migth want to run the Powershell prompt as an administrator.
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")            
$publish = New-Object System.EnterpriseServices.Internal.Publish            
$publish.GacInstall("c:\temp\MyDllFile.dll")            
iisreset

The first line adds a reference to the assembly we need to be able to mange the GAC.
The second and third lines retrives the GAC object and publish a new DLL file to it.
The last line resets the Internet Information Services. This is only needed if your DLL file is used in a website hosted in the IIS.

Powershell - Remove DLL from GAC

If you need to remove a DLL file from the GAC there is also a script for this.
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")            
$publish = New-Object System.EnterpriseServices.Internal.Publish            
$publish.GacRemove("c:\temp\MyDllFile.dll")            
iisreset

mandag den 20. oktober 2014

Project Server Read only Custom Fields (Javascript)

PROJECT SERVER - Make Custom Fields Read Only

The fields on the PDPs (Project Detail Pages) is always editable unless you make them read only in a workflow stage or use the calculated field as suggested in my other post.

http://technicaltrix.blogspot.dk/2014/09/project-server-read-only-custom-fields.html
If you want to make a custom field read only without using aditional custom fields you have to do it through Javascript.
In the following i will explain how we can make custom fields read only through Javascript.

Insert a Content Editor webpart to the PDP page where the field you have the field that should be made read only.

Select the webpart and from the ribbon select HTML->Edit HTML Source.
Copy/Paste the following code into the Content Editor webpart.


<script type="text/javascript">
function makeReadOnly()
{
 var elements=document.body.getElementsByTagName("INPUT");
 for (index=0; index < elements.length;++index)
 {
  if(elements[index].type=="text")
  {
   if(elements[index].title=="Project Number") //Field name
   {
    elements[index].disabled=true;
   }
  }

 }
 setTimeout(makeReadOnly, 500);
}
setTimeout(makeReadOnly, 100);
</script>


Replace “Project Number” with the field you want to make read only.

Click OK and Stop Editing and the field name should be updated.
Now the field is read only when viewing the PDP.

lørdag den 18. oktober 2014

Windows 10 Start Apps in Full Screen


Launch Windows 10 apps in in full screen mode

If you recently have installed the Windows 10 Technical Preview on a tablet or computer system, you may have noticed that Windows Store apps run on the desktop now if you are using a system with mouse and keyboard.
I installed Windows 10 on my Surface pro one, but haven't seen any report saying the other models behave differently.
While it is still possible to enable the Start Screen interface, instead of using the Start Menu as you cannot use both it seems, apps that you run will run in Windows desktop mode by default.
That's not a big problem most of the time, but if you prefer to run some apps in full screen, Netflix or a game for example to get that extra bit of screen space this way, then you may have wondered how to make that happen.
There is no full screen option when you look at the window control icons in the top right corner of the screen. While you can use the controls to maximize the app window, it is still running in a window and not full screen.

To view an App in full screen mode simply select the tree dots in the left cornor of the App. Here you will see a few options:
Selecting the Full Screen option will display the App in full screen mode. To exit the full screen mode simply push the windows button.

I have not found any way to have all Apps automatically start in full screen mode. But I suppose the RTM release of Windows 10 will detect what device you are on (tablet/laptop/PC) and display the best setting for you.

søndag den 12. oktober 2014

Ask me anything...

In the comments section below feel free to ask me any questions related to Microsoft Project Server, Project Server Programming (VBA/PSI/CSOM/Powershell), SharePoint or Project Portfolio Management in general.

fredag den 10. oktober 2014

Project Server Budget/Financial Management

Have you ever tried to do budget mangement in Project Server without UMT's financial mangement plugin (UMT 360). This can be a complex task as you do not want a very detailed plan of the financial usage, but rather just track the approved budget from the steering comittee.

UMT 360 can do a lot of cool stuff with your financial data. But if your company are not ready for the full rollout of this module and just want to track if the projects and departments are on track a more simple solution could be the answar.

This is where Projectum's app "Project Financials" come into the picture.

This app simply adds a new area to your project page (PDP) which allows you to save the budget for the Project.


This can then be summed up and catagorized in some nice reports.


Try it out!!

torsdag den 2. oktober 2014

Powerpoint presentation viewer in SharePoint/Project Server

To have a Powerpoint presentation running on your SharePoint, Proejct Server or workspace site follow these simple steps.

 1. Copy the URL to the Powerpoint (located in a document lib in SharePoint)
Capture.PNG
 2. Insert a content editor webpart.
 3. In the HTML below, replace the file UID and the server name. 
 4. Insert the modified HTML into the webpart.
URL:
https://server/apps_products_and_concepts/_layouts/15/WopiFrame.aspx?sourcedoc=%7BF35655A3-7E70-41ED-A94C-75E9DBD24FF1%7D&file=Apps.pptx&action=default
HTML:
<iframe width="550" height="347" src="https://server/apps_products_and_concepts/_layouts/15/WopiFrame.aspx?sourcedoc={F35655A3-7E70-41ED-A94C-75E9DBD24FF1}&amp;action=embedview&amp;wdAr=1.7755102040816326&amp;Embed=1​" frameborder="0">This is an embedded &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;a target=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;#39;_blank&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;#39; href=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;#39;http://office.com&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;#39;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;Microsoft Office&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; presentation, powered by &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;a target=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;#39;_blank&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;#39; href=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;#39;http://office.com/webapps&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;#39;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;Office Online&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;.</iframe><br/>​