Showing posts with label SharePoint 2007. Show all posts
Showing posts with label SharePoint 2007. Show all posts

Thursday, December 11, 2014

PowerShell and delegates

At my current project, we have written a lot of PowerShell. We came to discuss whether, we can use delegates in PowerShell or it is a pure C# (.net) thing. The short answer is yes, you can do it. The syntax is like this:

1 $url = "http://win-l2sfc3oetnn"
2 function GetSiteElevatedPrivileges
3 {
4 $site = new-object "Microsoft.SharePoint.SPSite" $url
5 write-host $site.RootWeb.Title
6 }
7 [Microsoft.SharePoint.SPSecurity]::RunWithElevatedPrivileges(${function:GetSiteElevatedPrivileges})

Wednesday, October 8, 2014

New version of one of my favorite tools

I know it is old new, by there is a new version of the ULS Viewer, with is one of my favorite tools. Bill Baer has a blog post on it. http://blogs.technet.com/b/wbaer/archive/2014/08/22/uls-viewing-like-a-boss-uls-viewer-is-now-available.aspx 

My previous on the tool http://blog.andersdissing.com/2009/12/great-uls-viewer.html 

You can download the new version there http://www.microsoft.com/en-us/download/details.aspx?id=44020

Thursday, November 28, 2013

How to load config file in PowerShell?

I had a problem with a customer where we would like to reuse one WCF endpoint from our web.config file. What Microsoft describes and a lot of blogs on the net, all you have to do is call [AppDomain]::CurrentDomain.SetData ("APP_CONFIG_FILE", $pathToConfig) http://msdn.microsoft.com/en-us/library/37z40s1c(v=vs.110).aspx. But it does not work because PowerShell already has loaded a config file loaded. Therefore, you should reset the config file “context” through reflection. To do so:

1 $pathToConfig = "C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config"
2 #Set the path to the new config file
3 [AppDomain]::CurrentDomain.SetData("APP_CONFIG_FILE", $pathToConfig)
4 [System.Configuration.ConfigurationManager].GetField("s_initState", [Reflection.BindingFlags] "NonPublic,Static").SetValue($null, 0)

Sunday, June 23, 2013

Start WVware machines through the command line

In my current SharePoint 2013 environment, based on WMware Workstation, that is made up by an AD/SQL, two frontend servers, a WAC/Workflow server and a guest client Windows 8 machine. Is a pain to start all five VM, through the VM interface.

clip_image001

Luckily has WMware Workstation exe file support for argument to start a virtual machine.

1 start vmware -x "\[path/file.vmx]"

So my new favourite cmd file, on my desktop, look like this:


1 @echo off
2 start vmware -x "D:\Virtual Machines\AD-SQL2\AD-SQL2.vmx"
3 start vmware -x "D:\Virtual Machines\SharePoint 2013 APP1\SharePoint 2013 APP1.vmx"
4 start vmware -x "D:\Virtual Machines\SharePoint 2013 WFE1\SharePoint 2013.vmx"

Saturday, November 6, 2010

Windows 7 Favorites and SharePoint

One of the many cool features in Windows 7 is the Favorites

This is a list of “shortcut” that is display in the Windows Explore and in the “save as” dialog in programs like Word.

clip_image001

clip_image003

The Windows 7 Favorites works by creating a shortcut to folder and this goes for WebDav folders to.

To setup the a shortcut to a SharePoint site

To setup the shortcut and you only need to do this one time. Open Word and to go “save as” (the shortcut for this is F12), enter the url for the SharePoint site in the file name (Only the url!) and click enter or click on the save button. Then right click on the clip_image004 and select “Add current location to Farvorites” and wola your SharePoint is add and it is easy to browse next time when you want to save a document. clip_image006

Sunday, December 6, 2009

A great ULS Viewer

I found this great ULS Viewer, I use to read the SharePoint log files with. One of the really cool things is the highlight function that’s build in, just by hover over a text the same text is high with a yellow background, soo cool :) But two of the most import features is to hide lines in the log and runtime-feed. Runtime-feed is to setup a "watch" on a directory and all now log (both lines in the current log file and lines in new log files is imbedded into the ULS Viewer view) .

clip_image001

clip_image002

clip_image003

A copy-pasting Microsoft own feature list:

  • Highlight data of importance to the user on the fly
  • Bookmark log entries
  • Append logs to other logs in order to track trends
  • Hide unimportant data
  • Only view critical log entries by sorting data by severity
  • Write rules to prompt the user when certain events occur
  • View your data in a spreadsheet instead of the text file ULS generates
  • Monitor remote machines logs that are running ULS services
  • Open multiple logs at the same time in order to compare log files.
  • Open logs files from multiple machines at the same time.

More screenshots of USL Viewer

Read more about this greater log reading tool at http://code.msdn.microsoft.com/ULSViewer

Thursday, November 19, 2009

Keyboard shortcuts for Windows SharePoint Services 3.0

Microsoft as writen this greate post about keyboard shortcuts in Microsoft Windows SharePoint Services 3.0 http://office.microsoft.com/en-us/sharepointtechnology/HA101756491033.aspx, love keyboard shortcuts :) And the 3.0 keyboard shortcuts is working in SharePoint 2010, like the site action and view all site content shortcuts :)

Wednesday, November 4, 2009

Connecting list in MOSS 2007

One of the many out-of-the-box functionalities in MOSS 2007 is connect list to Outlook e.g. Contacts list. This is great to have the rich and familiar interface from Outlook and still have a central place to share the information.

So the quick guide to setup a Contacts list in SharePoint and connecting it to Outlook.

  1. First we create a contact list in SharePoint
    clip_image001

    clip_image002
  2. Populate the list with dummy data
    image

    clip_image003
  3. Connecting the list to Outlook
    clip_image004

    clip_image005

    clip_image006
  4. And now the list is connected to Outlook
    clip_image007
  5. Create a new contact through Outlooks rich interface
    clip_image008

    clip_image009
  6. Refresh the list view in SharePoint
    image