Thursday, January 30, 2014

Local SMTP with Sharepoint 2013

Sharepoint isn’t very flexible when it comes to email server.

Enter the local smtpserver.

  1. Install SMTPServer
  2. Configure SMTP-Service using IIS6.0 Management Tools
    1. Access>Relay image
    2. Delivery>Outbound Security>basic authentication image
    3. Delivery>Outbound Connection> Specify TCP port
    4. Delivery>Advanced image
    5. All OK.
  3. Configure Centralt Administration>Web Application> Outgoing email = myserver.mydomain.local

It should work immediatly. No need to reset IIS or restart the smtpserver.

Sometimes youre mailing servers you cant verify settings on. Then Gmail can be used to verify the mailflow.

For google

  • Basic Authentication = , pwd: mypassword, use TSL
  • Use TCP port 587
  • Smarthost =

To check email flow on local server, drive:\inetpub\mailroot\queue folder can be monitored. When mail is sent from sharepoint ,it lands in this folder while contacting the smtpserver. When there’s a problem, the mail will be stuck here. In some situations it might be needed to empty this folder, then content in this folder can be deleted if the iisadmin service first is stopped.

/>stop-service iisadmin

/>start-service iisadmin

/>start-service smtpsvc


Sunday, January 26, 2014

Excel datedif formula

Useful excelformula that is hidden from the common gui, but present in all version of excel.

To compare a date to today

Outputs difference in days. Can also return in complete months, years and then some.


Number of days

MNumber of complete months

Number of complete years


Number of days excluding years


Number of days excluding months and years


Number of months excluding years

Note that on Swedish systems formulas look like this instead:


Comma is replaced by semicolon for some reason.


Friday, January 24, 2014

Windows phone on Windows 8.1

While trying to copy files to my Lumia 520, my windows didn’t show the phone in my computer.

To solve this

1. Install Window Phone App

Why? I don’t know, this is supposed to work out of the box. But it might be an issue since Lumia 520 is a pretty cheap issue.

Or the issue might be that Metro-phone app stole the attention.

This is how its supposed to look: image

Now we can copy files like an usual folder.

Now, how do we do this wirelessly?

Thursday, January 23, 2014

Thumbs in Searchresults in SP2010

Was working from instructions trying to get Thumbnails from an Assetlibrary to be displayed in an Searchresultspage, but couldnt get the thumbs to stick.

Finally I tried removing “contentypeforsearch.=’image’  frome the xsl-customizations and it started working right away. Somehow the images in my results wasn’t interpreted as images. Maybe the .jpg filetype needs to added manually or something.

In this case, its a Imagesearch result page so the results are always images.

It works, im happy. customer happy. Done.


<xsl:when test="contenttypeforsearch[. = 'Image'] and contentclass[. = 'STS_ListItem_851']">


<xsl:when test="contentclass[. = 'STS_ListItem_851']">

References: – the moneyshot – a bit old, still generally informational. – details regarding how the crawling properties works.

Wednesday, January 22, 2014

Remove borders from View Style Boxed


For a case im using a link-list on a startpage. Reasons include making it easier for endusers to manage their own used applications, without rummaging around with tables etc.

For this reason the boxed view style served me well.


The box-borders gave an ugly look. To remove these, add content Editor webpart and insert

<style> {
    BORDER:0 !important;

Effect should be immediate.


Tuesday, January 21, 2014

Re-arm trial Server 2008+

While doing labs, applying snapshots and whatnot the licensekey sometimes disappears or you just dont wanna waste an activation on a testmachine.

To re-arm a Server triallicense

Elevated Cmd-prompt

Check current licenselevel

/>slmgr.vbs –dli

Extend the evalution period with another 60 days

/>slmgr.vbs –rearm

Server can be rearmed up to 3 times giving you a total of 240 days.


Monday, January 20, 2014

Shared folders using ps

To create a shared folder using powershell

New-SmbShare –Name ShareName –Path C:\LocalFolder

To get permissions on existing

Get-SmbShareAccess –Name ShareName



Thursday, January 16, 2014

Filtrera listvyer med localized Sharepoint

För en lokaliserad version av Sharepoint 2010 så används även svenska på de logiska funktionerna. Det är väl ok, när man kommer till ro med att det går att använda åäö på funktioner “Date=Datum,Year=År,Month=Månad etc”. Det som är knepigare att få grep och är varför de bytt ut skiljetecknen!

För att få fram en första dagen i en månad baserat på ett datumfält så funkar i Engelsk version denna:

=DATE(YEAR([Due Date]), MONTH([Due Date]), 1)
Motsvarande funktion på Svensk version:
Notera att “,” är utbytt emot “;” på svensk version. 

Så för att filtrera en listvy baserad på vilken månad som är angivet i ett fält kan följande metod användas.

  1. Skapa kolumn Visning(datumtyp)

  2. Skapa kolumn MonthEnd(beräknad) : formel =DATUM(ÅR(visning);Månad(visning);1)  output=dateimage[6]

  3. Skapa kolumn MonthStart(beräknad) : formel=DATUM(ÅR(visning);månad(visning)+1;1)-1   output=date

  4. Skapa vy,

    1. filtrera med MonthStart är mindre än eller lika med [I dag]

    2. Filtrera med MonthEnd är större än eller lika med [I dag]




Taskmanagement in powershell

My favorite commands tasklist and taskkill are getting old. Time to get on the powershell bandwagon now when xp is losing its supported-status.

For tasklist-like results

/>get-process |where-object {$_.processname –like msiexec}

Where msiexec is queried process

For taskkill-like results

/>stop-process –name notepad

Where notepad is process to be killed.

Also nice to have


Which is pretty obvious. Restart immediatly on default. Use with scheduler for more use.

References: - restart-computer - stop process - stop process - get process - restart-computer enhancements in ps3.0

Friday, January 10, 2014

Free up space in Windows 8

This is sort of up there in terms of freeing up space. A bit over the top for the ordinary users.
There is however a method of removing the install files for Windows features you don’t need. It goes like this:
/>dism.exe /online /disable-feature /featurename:sua /remove
But if you want to remove a lot of not needing features this could be tedious. enter powershell
foreach ($item in get-content featuresclean.txt)
write-host "Removing feature $item"
dism.exe /online /disable-feature /featurename:$item /remove
Where featuresclean.txt is a file where every line contains a feature to be flushed.
To get all windowsfeatures on the system in a single list it can be a bit tricky.
I solved it a bit rough bit
/>get-windowsoptionalfeature –online |? state –eq ‘disabled’ |export-csv output.csv
and then copied the relevant columns from the csv to featuresclean.txt
Really not recommended if you don’t know what your doing

Tiny calender in SP 2010

Customer want a small calenderview. Like the one in Outlook.image

This can be achived using all built in tools with some css tinkering.

You need:

  • A calenderlist using a calenderbased view
  • A content editor web part


  1. Insert webpart using calenderview
  2. Insert webpart content editor webpart (CEWP)
  3. Edit CEWP

.ms-acal-header TD {
.ms-acal-rootdiv TD {
.ms-acal-rootdiv TH {
.ms-acal-rootdiv {
    OVERFLOW: hidden; FLOAT: right; MARGIN-LEFT: 0px
.ms-acal-vitem {
.ms-acal-month-weeksel {
    WIDTH: 5px; VISIBILITY: hidden
.ms-acal-summary-dayrow TH {
    CURSOR: pointer; BORDER-TOP: #b6c5c6 0px solid; BORDER-RIGHT: #b6c5c6 0px solid; BORDER-BOTTOM: #b6c5c6 0px solid; BORDER-LEFT: #b6c5c6 0px solid; VISIBILITY: hidden; BACKGROUND-COLOR: #ced8d9
.ms-acal-month-top {
    WIDTH: 20px; BORDER-BOTTOM: #b6c5c6 1px solid; COLOR: #919649; PADDING-BOTTOM: 2px; TEXT-ALIGN: center; PADDING-TOP: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px
.ms-acal-summary-dayrow TH {
    CURSOR: pointer; BORDER-TOP: #b6c5c6 0px solid; HEIGHT: 0em; BORDER-RIGHT: #b6c5c6 0px solid; BORDER-BOTTOM: #b6c5c6 0px solid; BORDER-LEFT: #b6c5c6 0px solid; VISIBILITY: hidden; BACKGROUND-COLOR: #ced8d9
.ms-acal-summary-itemrow TD DIV {
    HEIGHT: 0px; WIDTH: 0px
.ms-acal-vlink IMG {
.ms-acal-vlink A:hover {

4. Save

Now this view will expand the row if there is an item on that week. Not so pretty, but itll work for this case.

  • Onhover on date the events of that day should be displayed
  • Date should be bold or different color if their is events on that day.



Wednesday, January 08, 2014

Useful ps filters

To filter results from a powershell query where-object can be used.

For example to filter get-spserviceapplication by field typename

/>Get-spserviceapplication |where-object{$_.typename –like “Search Service”

will result in all objects that contains Search Service. Switch –like for –eq to more precise results.

To get specific field to a variable

/>$serviceid = Get-spserviceapplication |where-object{$_.typename –like “Search Service”  |select id

Simple but powerful.


Firefox Disable full screen warnings

To get rid of annoying full screen warnings in Firefox


  1. About:config
  2. Set Full-screen-api.approval-required to false.
  3. Restart Firefox