Wednesday, February 26, 2014

Hide page title

Before to the left, after to the right
  1. Create txt file named removepagetitle.txt
  2. Enter :
  3. <style>
    .ms-core-pageTitle{Display:none !Important;}
  4. Upload removepagetitle.txt to your site, for example Site Assets\CodeSnips\
  5. On page insert Content Editor, link your removepagetitle.txt
  6. Title disappears.
Obviously this also can be inserted to a central css and be rid of without pesky webparts, but nice if you want some options.

When using the oslo-masterpage code below seems to do the trick.
<style> #pageContentTitle { display: none !important; } </style>

Friday, February 21, 2014

Extract year from date in SPD

Create Sharepoint Workflow 2010

1. Create 2 variables, wholedate and year

2. Define functions

Set Variable:wholedate to currentitem:start time   (return field as ISOFormatted)

  then copy 4 characters from start of variable:wholedate(output to:variable:year)

  then log variable:year to the workflow history list




Thursday, February 20, 2014

Quick Steps in Lists

Often neglected, I find this hidden feature useful for making no-code solutions.
Its a bit messy though.
To create, go to SPD > List > Custom Action > Choose where the button should appear. Its not completly obvious in my opinion so I’ve listed the name and where they’ll appear below.
When creating the manually from SPD, we got more alternatives than when creating a Quick Step directly from the Webgui. For example we now can add a webaddress, which can lead anywhere, either a local place on the sharepoint or somewhere offsite.
ListItem – Shows on the submenu on the listitem.
Edit Form – Shows in the Edit Form.
Display Form – shows in the Display Form.
New Form – shows in the New Form
View – Shows in the List Ribbonmenu
From this custom actions we can also configure where the link should appear to some degree by modifying the Ribbon Location ID
For example, the Display Form button lands in the Manage container per default.
If I want to move this icon to right part of the form, I can change the .Manage. to .Actions.

References: - nice overview of where we can place our buttons.

Wednesday, February 19, 2014

Disable java warnings

Java keeps blocking my stuff.

Figure that Procurve switches doesn’t come with signed applets.

Nothing worked while trying to access a procurveswitch after latest Java-update. Wouldn’t even get the option of running anyways.

To get it running:

Java Control Panel > Advanced> Security > Mixed Code > Disable Verification


Now its only one warning about unsigned stuff, haven’t managed to kill this one yet.

I usually prefer to avoid java on my machines, but when it comes to Procurve-switches its unfortunately required.



What happend with Low?


Deploy MSI-package from GPO

To deploy msi package to from GPO.

1. Create GPO DeployPackage

a. User Configuration>Policies>Software Settings>Software Installation

b. Create new package, choose msi to deploy. Must be located on a shared folder that has read permissions for authenticated users (to include all domain computers).

c. Choose Published

d. Choose newly created package, Change Deployment>Deployment Type to Assigned and Check Deployment options>Install this application at logon

2. Deploy this GPO to an OU where the User object is located.

3. GPUpdate /force on both server and client.

4. If all works, the client will notice the policy and request a restart.

5. Package should deploy as soon as logged in.


Friday, February 14, 2014

Hide columnheaders on a webpart

To hide headers on a webpart
  1. Add a contenteditor webpart
  2. Edit HTML-source
  3. Paste
  4. <style>
    .ms-viewheadertr {
    DISPLAY: none
  5. Columns should disappear at once. Hide webpart from form.

References: cant hide when using publishing pages.

Thursday, February 13, 2014

Word with values from Document Library Columns


  1. Upload Wordtemplate to documentlibrary
  2. Create Site Content Type
  3. Advanced Settings > Enter url of wordtemplate in documentlibrary
  4. Associate site content type with your documentlibrary
  5. Edit Word Template in documentlibrary
  6. In Word, Insert > Quick Parts > Document Property >
  7. Choose your list columns, should be at the bottom.Place in wordtemplate at your leisure.
  8. Now, when creating new template from this Site Content Type the field will be automaticly populated with the columns values.

Using folders as metadata-masters

A handy feature to use when bulk-uploading documents to Sharepoint is the “Default Column Value”. This feature shines when using folders.

For example, say $user wants to upload 2000 images to an assetlibrary and wants to tag these with managed metadata values, 3 of them for a third of the lot and something else for the rest. Managed metavalues can’t be edited in datasheet view when using multiple values so this might take some time for $user.

In this case $user could create three folders in the assetlibrary and from Library Settings>Column Default Values > Folder  change the values as $user wants.


Now all documents copied to this folder, even from ExplorerView, will get these default values. Unless manually specifying something else.

The cool thing is that when the values have been set, $user can copy the images elsewhere in the documentlibrary and the metadata will still be attached. So folders can be used as a transitstation for settings metavalues. Or just be presented with a flat structure in the view.


Friday, February 07, 2014

Alerts not working for some users

Nuisance mayor.

A client had an issue with alerts not working for some users.


Sorry something went wrong. The following users do not have an e-maildress specified:

Turned out email issues overall for these users.

Tried did not succed.

  • Restarted Server
  • User Profile Sync new full
  • Removed failing users profile from User Profiles and did a new full sync.
  • Changed settings for email in AD, synced verified changes where coming through. Changed back, still same issue.


Tried running />get-spuser –web http://myserv | select userlogin,displayname,email 

Noted that email was missing for the difficult users. Now why is that?

Verifed that Replicable was activated on the User Profile Properties settings for the emailfield. All looked good.

Fixed it by running :

/>$myuser = get-spuser –web http://myserv |?{$_.displayname –like “*myuser*”}

/> set-spuser –identity $myuser –web http://myserv –SyncFromAD

To identify accounts with no email

/> get-spuser –web http://myserv | where {-Not $} |select userlogin,email

To output add |export-csv myusers.txt


External client weren’t so interrested in putting in more time to figure out exactly what was wrong in the first place. New users for example are adding their email field from the AD without any issues. The problem users were added to the site prior to defining the email attribut in the AD so that may have been an issue aswell. Im still fidning it odd that the email were looking like they should in the User profile Services but not when using powershell. might be that the user profile service is making a lookup in the AD when browsing the profiles, but can’t be sure .

Solution found. Cause unknown. ill revisit this later.

References: – email not available efter moving user Tells us email must be added prior to adding user to sp.

Wednesday, February 05, 2014

Schedule a powershell script

When certain task has run, its nice to be notified. since email function is deprecated in taskscheduler we have to pull out powershell.


1. Create the script


$psemailserver = ""
$receiver =
$from =
$subject = "Task has run"
$body = "Scheduled task $task has run. "
send-mailmessage -to $receiver -from $from -subject $subject -body $body
write-host "Mail sent for $task"
write-eventlog -logname Application -source "my script" -entrytype information -eventid 1 -message "$task has run"

2. Create the call using Task Scheduler “powershell –file “c:\myfile\sendmail.ps1” “helloworld”

What the script does is take an input variable and sending an email using defined smtpserver in the script. When mail is sent, it also logs en event in the application eventlog with source “my script”. The param is optional, but helpful if you want more reusability.

The source needs to created the first time manually, or use an already existing source.

Create source “my script” in application

/>New-eventlog –logname application –source ”my script”