Friday, January 10, 2014

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

Steps:

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

<style>
.ms-acal-header TD {
    VERTICAL-ALIGN: top
}
.ms-acal-rootdiv TD {
    VERTICAL-ALIGN: top
}
.ms-acal-rootdiv TH {
    VERTICAL-ALIGN: top
}
.ms-acal-rootdiv {
    OVERFLOW: hidden; FLOAT: right; MARGIN-LEFT: 0px
}
.ms-acal-vitem {
    VISIBILITY: hidden; BACKGROUND-COLOR: #f2f2f2
}
.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 {
    VISIBILITY: hidden; MARGIN-RIGHT: 3px
}
.ms-acal-vlink A:hover {
   
}</style>

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.

image

References:

http://www.sharepointgrind.com/Lists/Posts/Post.aspx?ID=19

http://blog.pathtosharepoint.com/2008/10/06/tiny-sharepoint-calendar-1/

http://erikswenson.blogspot.se/2013/04/small-calendar-for-sharepoint-2010-2013.html

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.

References:

http://windowsitpro.com/powershell/where-object-filter-filters

Firefox Disable full screen warnings

To get rid of annoying full screen warnings in Firefox

image

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

image

Tuesday, December 17, 2013

Autoend task Windows 8.1

More annoyances. When I choose reboot or shutdown windows timeouts and waits for the user to actually push end tasks. This happens on most of my W8 machines.

To shutdown these apps more brutally heres another reghack.

-----autoend.reg-------------

Windows Registry Editor Version 5.00

[HKEY_USERS\.DEFAULT\Control Panel\Desktop]
"AutoEndTasks"="1"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control]
"WaitToKillServiceTimeout"="2500"

------------------eof----------------

 

References:

http://www.anushand.com/2013/02/auto-end-tasks-windows-8-at-shutdown.html

http://www.reddit.com/r/windows/comments/1936nl/waiting_for_background_programs_to_close_how_do_i/

Saturday, December 14, 2013

Windows 8.1 and the mythical WinSxS

To see the actual size of the WinSxS folder in Windows 8.1

/>dism /online /cleanup-image /analyzecomponentstore

Backups and Cache is the actual space used by WinSxS

To cleanup the folder in Windows 8.1

/> dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
To do it on previous versions (to w7 or vista)
/>dism /online /cleanup-image /spsuperseded
After running this command its no longer possible to uninstall updates or servicepacks. But most people don’t and if you change your mind, you can always get the msi-package and still do an uninstall.
 


References:


http://technet.microsoft.com/en-us/library/dn251566.aspx


http://technet.microsoft.com/en-us/library/dn251565.aspx

Thursday, December 12, 2013

Disable alerts

In some scenarios we don’t want our users to able to use alerts on lists or libraries on a en entire site.

Reason for this could be to simplify for the users, less clutter, or simply cause you don’t want it to be possible to put alert on sites that might carry sensitive information that shouldn’t be sent over the wire.

More and more people host their email off-premises these days and not everyone is up to speed on TLS just yet so this kind of scenarios is getting more common.

To disable Alert for an entire site:

  1. Central Administration > Application Management> Manage Web Applications >
  2. Current Site > General Settings> Alerts > Alerts on this server are = Off
  3. Verify on the site.

Changes appear immediately without any reset.

Before: image

 

After: image

References:

http://technet.microsoft.com/en-us/library/dn178511.aspx

Setting permissions on calendars

A customer want two specifik users to have edit permissions on certain users in the company. It’s many users, is a situation that might have to be done again and again.

So we use powershell for the solution.

First we created a script to check the current permissions to get a baseline of what we’re working with.

foreach ($user in get-content editcalendarusers.txt)

{

write-host "Permissions for user: $user" -foregroundcolor red -backgroundcolor yellow

get-mailboxfolderpermission ${user}:\calendar

}

Where editcalendarusers.txt is a text with one username per line. This is also a good way of validating your editcalenderusers.txt list, to catch any errors or localized boxes.

Since set-mailboxfolderpermissions only can edit existing userpermissions, not add new ones, we first need to run add-mailboxfolderpermission on our userlist. If an account already exist ps throws an error, but no changes are made. Other users already added to the permssions aren’t modified.

First script

----addperm.ps1----

foreach ($user in get-content editcalendarusers.txt)

{

add-mailboxfolderpermission ${user}:\calendar -user john.doe -Accessrights Editor

write-host "john.doe added as editor for $user."

add-mailboxfolderpermission ${user}:\calendar -user charles.doe -Accessrights Editor

write-host "charles.doe added as editor for $user."

}

-----eof-----

Second script

----setperm.ps1.

foreach ($user in get-content editcalendarusers.txt)
{
set-mailboxfolderpermission ${user}:\calendar -user john.doe -Accessrights Editor
write-host "john.doe added as editor for $user."
set-mailboxfolderpermission ${user}:\calendar -user charles.doe -Accessrights Editor
write-host "charles.doe added as editor for $user."
}

---eof-----

If the permissions already are set the second script reports this and goes on to the next line.

One error we ran into was that a few users had changed the language on their mailbox. On these we exchanged the :\calender for the correct folder. In our case :\kalender .

Now obviously we could have made this less static by adding a second loop to process the editors but in this case there were only two so it wasn’t really necessary in this case.

References:

http://technet.microsoft.com/en-us/library/dd298062%28v=exchg.150%29.aspx

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...