All posts by Atle

Phone 7 error “Download incomplete ….”

After upgrading to Mango I got an error message on my phone when I tried to download attachments or images : “Download incomplete. We will …..” . I only had this error on one of the Exchange accounts that I was syncing to my phone. Solution was to reimport CA certificate and reboot. The one server that was failing was using a private certificate.


Error 1603 installing Exchange 2010 RollUp’s

Getting error installing Rollup 5 for Exchange 2010 Sp1. Error 1603. According to msi log file it is ServiceControl.ps1 that is causing the error. Solution was to set execution policy to RemoteSigned and also run the “ServiceControl.ps1 AfterPatch” script from the Exchange 2010 Bin folder . Also remember to start Powershell as administrator.

set-executionpolicy -executionpolicy RemoteSigned

.\servicecontrol.ps1 AfterPatch

After this the install turned out OK.

Test network with filecopy and Powershell

Needed a way to test and time filecopy between servers using powershell. This is what I came up with. This example will use copy to server and time the progress. I used a file of 1.8 Gb.

foreach($server in $Servers){
if (!(test-path \\$server\share\temp)) {
    new-item -path \\$server\share -name temp -ItemType Directory
$start = get-date
copy-item C:\temp\ -Destination \\$server\share\temp\
$end = get-date
Remove-Item \\$server\share\temp\
[TimeSpan]$Totaltid = new-timespan $start $end
write-host $($server) – $($Totaltid.seconds)s

Install Windows Phone 7 SDK on windows 2008 R2

Aaron Stebner’s WebLog shows us how to install Windows Phone 7 SDK on Windows 2008 R2.

  1. Download the Windows Phone Developer Tools web bootstrapper and save it to your hard drive
  2. Extract the contents of the setup package by running vm_web.exe /x and choosing a path to extract to
  3. Go to the folder you extracted to in step 2 and open the file baseline.dat in notepad
  4. Look for the section named [gencomp7788]

    Note – you have to change this exact section – this is the one that controls the OS version blocking behavior in Windows Phone Developer Tools setup.

  5. Change the value InstallOnLHS from 1 to 0
  6. Change the value InstallOnWin7Server from 1 to 0
  7. Save and close baseline.dat
  8. Run setup.exe /web from the folder you extracted to in step 2

Updated: This also works for WP7.1 sdk Laughing

List activesync device statistics

Some times it is usefull to get a list of when did devices last sync.

get-mailbox | ForEach-Object { Get-ActiveSyncDeviceStatistics -Mailbox $_.Identity;}| Out-File -filepath c:\powershell\activesync.txt

Or if you want to list spesific devices:

get-mailbox | ForEach-Object { Get-ActiveSyncDeviceStatistics -Mailbox $_.Identity;}|where {$_.devicefriendlyname -eq “Touch_DUal”}| Out-File -filepath c:\powershell\activesync.txt


Preparing for my next certification.

I have been working with Lync since the early beta versions. Now I think it is time to test my skills and go for TS 70-664 Configuring Lync server. Here in Norway nearly all our customers are medium (->600 employees) so some functions built for large enterprises are rearly used. These are the things that I will have to read extra carefully, and my lab environment  will continue to grow.



List used phone numbers in Lync

This will list all used phone numbers in Lync. Except those used by Exchange UM (Auto Attendant ..)

$LUser=Get-csuser -Filter {LineURI -ne $Null}
$PLUser=Get-CsUser -Filter {PrivateLine -ne $Null}
$LCommonarea=Get-cscommonareaphone -Filter {LineURI -ne $Null}
$LAnaloge=Get-csanalogdevice -Filter {LineURI -ne $Null}
$LAppEndPoint=Get-CSApplicationEndPoint -Filter {LineURI -ne $Null}
$LExchUM=Get-CsExUmContact -Filter {LineURI -ne $Null}
$LDialIN=Get-CsDialInConferencingAccessNumber -Filter {LineURI -ne $Null}
$LDevices|sort-object -property Lineuri | ft DisplayName,LineUri


*.cshtml files return html error 404 in BlogEngine.NET 2.5

I was searching for some help on this error for days. Tried adding different mappings. Then I found this page :


HTTP Error 404.3 – Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

The solution is, to add the following handlers to web.config:

    <add name="cshtml-ISAPI-4.0_32bit" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" 
scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="cshtml-ISAPI-4.0_64bit" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule"
scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /> <add name="cshtml-Integrated-4.0" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler"
preCondition="integratedMode,runtimeVersionv4.0" /> </handlers> </system.webServer>

Added this settings to the web.config file in the admin folder and “Wham bam thank you…….”. Now it it works.



Move Lync database to new sql server.

This is how I’ve done it. First in lab then in production. This is moving enterprise edition databases. For this to work you need one extra temporary sql server and one Lync server in a temporary Lync pool ,along with the new SQL production server.

1. Export Lync configuration just in case.
export-csconfiguration -file c:\
export-cslisconfiguration -file c:\
2. Install a new Lync server in a new pool. I.e temppool.corp.local
3. Install a new CMS (configuration management store) on temporary sql server.
install-csdatabase -CentralManagementDatabase -sqlserverfqdn tempsql.corp.local
4. Enable topology.
5. Logon to new server in new pool and move CMS Lync server.
Verify that you are moving it to the new server and select.
Wait for replication.
6. Uninstall old CMS database.
Uninstall-csdatabase -CentralManagementDatabase -sqlserverfqdn OLDSQLSERVERFQDN.corp.local
7. Backup Lync databases. All of them.
8. In topologybuilder create a new sql server at the enterprise pool properties and publish topology.
9. Run Lync server setup deployment wizard.
10. Turn off all Lync frontend servers.
11. Restore Databases to the newley created databases. Remember to enable Chaining on the RTC and RTCDYN databases. Enable cross database chaining in the sql server properties. (SQL 2008 R2) In SQL-query : alter-database rtc set db_chaining = on alter-database rtcdyn set db_chaining = on
12. Start Lync servers.
13. Mover CMS to new SQLserver. step 1 – 6
14. Delete temppool from topologybilder and publish.

SMTP unreliable links

Had a problem with large emails between exchange 2010 servers. Got the smtp error 421.4.4.2 . I solved this by increasing the MaxProtocolError and ConnectionTimeout on the receiving connector. Use the powershell set-receiveconnector . In this senario we are talking about a 1mb sat link.