Wednesday, February 26, 2014

Hide page title

Before to the left, after to the right
imageimage
Solution:
  1. Create txt file named removepagetitle.txt
  2. Enter :
  3. <style>
    .ms-core-pageTitle{Display:none !Important;}
    </style>
  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>
References:
http://social.technet.microsoft.com/Forums/sharepoint/en-US/47f10498-d72a-446d-9b26-840fb89f9142/how-to-hide-site-title-in-sharepoint2013?forum=sharepointgeneral

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

image

image

References:

http://weblogs.asp.net/wesleybakker/archive/2010/12/28/get-datepart-in-sharepoint-designer-workflow.aspx

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.
image
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.
image
Examples:
ListItem – Shows on the submenu on the listitem.
image
Edit Form – Shows in the Edit Form.
image
Display Form – shows in the Display Form.
image
New Form – shows in the New Form
image
View – Shows in the List Ribbonmenu
image
From this custom actions we can also configure where the link should appear to some degree by modifying the Ribbon Location ID
image
For example, the Display Form button lands in the Manage container per default.
image
If I want to move this icon to right part of the form, I can change the .Manage. to .Actions.
 image

References:
http://blog.furuknap.net/sharepoint-2010-ribbon-locations - 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

image

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.

 

image

What happend with Low?

References:

http://gdgtry.com/2010/05/disable-javas-new-security-warning/

http://service.parachat.com/knowledgebase/273/I-see-a-Do-you-want-to-run-this-application-security-warning-with-Java-7-Update-10.html

http://jaxenter.com/unsigned-java-applets-hit-by-security-update-46755.html

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.

image

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.

image

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.

References:

http://social.technet.microsoft.com/wiki/contents/articles/11301.sharepoint-2010-bulk-metadata-tagging.aspx

Friday, February 07, 2014

Alerts not working for some users

Nuisance mayor.

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

image

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.

Success:

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 $_.email} |select userlogin,email

To output add |export-csv myusers.txt

Conclusions:

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:

http://social.technet.microsoft.com/wiki/contents/articles/13771.troubleshooting-steps-for-sharepoint-alert-email-does-not-go-out.aspx

http://www.sharepointdiary.com/2012/02/sharepoint-alerts-not-working-troubleshooting-checklist.html#ixzz2aSvOz3hB

http://patrikluca.blogspot.se/2008/06/alerts-not-working-for-some-users-on.html

http://blogs.msdn.com/b/tehnoonr/archive/2009/10/13/sharepoint-alerts-emails-don-t-work-on-some-vmware-systems.aspx?Redirected=true

http://www.stuartroberts.net/index.php/2013/07/10/user_profile_sync/#more-1488 – email not available efter moving user

http://sharepointpratik.blogspot.se/2013/03/the-following-users-do-not-have-email.html

http://blogs.technet.com/b/steve_chen/archive/2009/11/20/alerts-in-sharepoint-troubleshooting-moss-wss.aspx

http://blogs.technet.com/b/harikumh/archive/2008/05/25/troubleshooting-alerts.aspx

http://www.harbar.net/archive/2011/02/10/account-deletion-and-sharepoint-2010-user-profile-synchronization.aspx

http://blogs.msdn.com/b/russmax/archive/2010/03/20/sharepoint-2010-provisioning-user-profile-synchronization.aspx

http://community.rightpoint.com/blogs/viewpoint/archive/2010/08/26/the-truth-about-how-daily-sharepoint-alerts-actually-work.aspx

http://social.technet.microsoft.com/Forums/sharepoint/en-US/b671a6c8-3065-4299-b7be-d40e9c5d982b/alert-me-error?forum=sharepointgenerallegacy Tells us email must be added prior to adding user to sp.

http://social.technet.microsoft.com/Forums/sharepoint/en-US/7c3947b9-c675-444c-b325-23185282eb74/user-email-not-updating-with-sharepoint?forum=sharepointadminprevious

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.

image

1. Create the script

-------sendmail.ps1-----

param([string]$task)
$psemailserver = "smtp.mycompany.com"
$receiver = john.doe@company.com
$from = task@company.com
$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"
------eof----

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”

References:

http://blogs.technet.com/b/heyscriptingguy/archive/2013/06/20/how-to-use-powershell-to-write-to-event-logs.aspx

http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/11/weekend-scripter-use-the-windows-task-scheduler-to-run-a-windows-powershell-script.aspx

http://stackoverflow.com/questions/16426688/passing-a-variable-to-a-powershell-script-via-command-line

Powershell and Uptimerobot

Uptimerobot can be quite tedious when you need to update many monitors at once. For example say you bought the license for Uptimerobot and n...