..:: I like SharePoint ::.. Rotating Header Image

SharePoint: Send Mail by using Powershell

Powershell has great functionalities. One of those is the sendmail function. We used it like a timer job for reminding people to do something special. We built a small script which checks certain list items in SharePoint and fetches the title, the create date and the author. If the item is older than 30 days, the author gets a reminder to do a task on the item.

The powershell is stored as scheduled task in windows. But i’d like to share the sendmail function with you.



$to = "you@mailadress.com"
$subject = 'Subject Text'
$body = 'Body Text'

#SMTP server name (which is configured in SharePoint)
$smtpServer = "SMTPServer"
#Creating a Mail object
$msg = new-object Net.Mail.MailMessage
#Creating SMTP server object
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
#Email structure
$msg.From = "yoursender@mailadress.com"
$msg.To.Add($to.Email)
$msg.subject = $subject
$msg.body = $body
$msg.isBodyHTML = $true
#Sending email
$smtp.Send($msg)


That’s it. Now you can put some values from the list into the body or subject or even the receiver address (to). Enjoy it.

SharePoint Days 2014 in Berlin – 10% Rabatt

Wer sich noch zu den SharePoint Days 2014 in Berlin anmelden möchte, sollte den 10% Rabatt Code nutzen.

Den Rabatt erhalten Sie bei Eingabe des folgenden Promotion Codes in das dafür vorgesehene Feld auf der Anmeldeseite der Konferenzwebseite (http://www.sharepoint-day.de/anmeldung.html): REF_FB_SPD_14

Die SharePoint Days finden zum fünften Mal
vom 02. Dezember 2014 (Workshoptag) und 03. bis 04. Dezember 2014 (Konferenztage) im Holiday Inn Berlin Airport statt.
Mit der erfolgreichen Etablierung der ShareConf in Düsseldorf im Sommer, haben sich nun auch die SharePoint Days als “Winterkonferenz” in Berlin zu einer festen Einrichtung als zweitgrößte SharePoint Konferenz entwickelt.
Zentrales Element der SharePoint Days ist das Networking der Teilnehmer untereinander und mit den hochkarätigen MVP’s und Referenten sowie unseren Sponsoren und Ausstellern.
Ich werde dort als Referent anwesend sein und das spannende Thema Wunsch & Wirklichkeit bei SharePoint Forms? Usability und Anpassungsmöglichkeiten vortragen.
Freue mich auf spannende Gespräche und Vorträge mit der SP Community.

SharePoint Missing Module when activating a feature

In the last weeks we resolved an error, which might be interesting for others as well. We got this Error message, that there was an error for a file from a specific module and that the list was not available.

Fehlermeldung

It came up at several features, if we tried to activate them. It was always a list which were used by the publishing features. The publishing feature were not activated, but could not be activated using the UI.

Therefore we used stsadm, to resolve it.



stsadm -o deactivatefeature -id f6924d36-2fa8-4f0b-b16d-06b7250180fa -url "http://server/sites/sitecollection" -force

stsadm -o activatefeature -id f6924d36-2fa8-4f0b-b16d-06b7250180fa -url "http://server/sites/sitecollection" -force


After that it worked well again. We assume that it had to problems with the publishing features.

Convert Content via SharePoint – Word Automation Services

I already made a post about the word automation services in SharePoint 2010. I then used Powershell to convert a word document to a pdf, which both were stored in a document library in SharePoint.

That was typically for 2010:

  • Solutions have to wait for a timer job to complete the converting process
  • Files can only be in SharePoint
  • No UI
  • No message if it’s done

The reason to create a new post is, that SharePoint 2013 offers a lot more things now which make the word automation services powerful and interesting in every direction. It now can offer

  • Conversion process is synchronized, immediate response is possible
  • Convert one file at a time per request
  • Setting options in Central Administration for simoultaneous requests
  • Notify / Updating files in SharePoint items if conversion is ready
  • Support of streams
    • Convert streams as inputs and outputs for file operations
    • Storing streams in the application server and worker manager not in the database

Let’s see how we can use it. I created a small console project to check the functionality. I found some cool functions which I used from this post and expand it to my needs. A second post was about using it as web service which might be really cool if you need a converter service for other applications or applications within sharepoint. (more…)

SharePoint 2010 Custom Workflow Actions for SP Designer

I already build up an easy workflow for SharePoint with Visual Studio, but i never did develope a custom SharePoint Designer workflow action. But now i got a requirement in a project in which we need to provide the possibility to convert an office document to pdf and store it in a completely different Site Collection.

Cause this part of action will be needed some more often, we decided to build up a custom SharePoint Designer Worklfow action. We had a SharePoint 2013 platform but no workflow manager in this farm. So the custom action is based on SharePoint 2010 workflow platform. The other great thing of custom SPD Workflow actions is that you can update them more easily than workflows itself. You do not need to update the whole workflow. You only need to update them if you change the .action file (you see later what it’s all about) and you can use them in every SharePoint Site you have.

So what is this? A SharePoint Designer Workflow Action is a piece of code, which will be executed inside the workflow. It can use parameters and variables. You know it from SharePoint Designer if you build workflows. You’ll find those actions in the ribbon and use it to define the steps a workflow should do.

SPDActivity_1

Let me show you how we succeded using this cool feature.

(more…)