Talent borrows... Genius steals

A lazy man's guide to working with Microsoft technology

Best Practices for SharePoint urls, External Access, SSL and TMG/ISA

clock January 21, 2010 03:57 by author Jay

Recently some of my peers and I were discussing what is best practice for configuring urls for SharePoint when intending to publish through ISA and use SSL. It goes without saying that in most scenarios, when using ISA and corporate credentials you’re going to use SSL for all external access through Threat Management Gateway/Internet Acceleration Server. The question then becomes where to terminate SSL.

From a security perspective, an argument can be made it’s not necessary to enable SSL on the SharePoint servers themselves (leaving internal traffic unencrypted) but you can avoid the security question and focus on usability. While TMG/ISA can do link translation and SharePoint Alternate Access Mappings also assists in ensuring the right protocol is returned for links, the fact is having one, well-known url to access SharePoint helps substantially in the usability department and also eliminates potential support issues.

One thing that may not be necessary (depending on your organization’s existing security practices) is using the public SSL cert on your internal site. We use a self-published cert internally and only use the public cert on the ISA gateway. This helps a little bit on cert management, which may or may not be a big issue for your organization.



Running PowerShell Scripts from Batch Files

clock November 13, 2009 11:00 by author Jay

So in an effort to prepare for SharePoint 2010 I’ve begun to start ramping up my PowerShell scripts. One of the first hurdles I found was the simple act of scheduling a PowerShell script to run via Windows Scheduler.

My chosen approach was to send the script output to a text file for logging. In order to do this I created a batch file to call the PowerShell script and issue a simple pipe command to send the PS output to the log file like so:

powershell.exe c:\my scripts\testscript.ps1 > log.txt

(Note, the purpose of the script is irrelevant for this post)

Running this script is going to return an entirely not unexpected issue with the fact that PS doesn’t like the spaces in the path:

The term 'c:\my' is not recognized as a cmdlet, function, operable program, 
or script file. Verify the term and try again.
At line:1 char:8 + c:\my  <<<< my scripts\testscript.ps1

 

Changing the batch file so it property encapsulates the command in quotes like so:

powershell.exe “c:\my scripts\testscript.ps1” > log.txt

doesn’t actually do anything.

In PowerShell what you need to do is tell PS to actually execute the script and you do that by placing an ampersand in front of the script like so:

powershell.exe &“c:\my scripts\testscript.ps1” > log.txt

Now the problem is going to be that everything after the call to PowerShell is expected to be PS commands (or parameters to the commands) and the cmd shell pipe character is not a valid PS command or parameter so all that happens with the above is a PS command environment is started.

The ay to fix this is to completely define exactly what we want the PS command processor to execute. You do this by using the command argument:

powershell.exe –command “&’c:\my scripts\testscript.ps1’” > log.txt

The above syntax does exactly as you’d expect it to. PS executes the command inside the quotes and the output is passed back to the cmd shell which pipes it out the log file.

Note that in the above syntax I switched the original double quotes to single quotes to avoid escaping issues. While in this case single quotes will work, single quotes and double quotes are not interchangeable in PS, so be sure to research the proper usage.



Using Bing Twitter Search to Research

clock November 12, 2009 05:49 by author Jay

One of the things I’ve really begun to appreciate is the vast amount of information that is being sent through Twitter. Before I needed to keep track of a bunch of blogs to find content that I might find useful over time.

One of the challenges I found was finding time to follow all the links that come across in tweets. Should I save them somewhere to follow later? Follow them and then book mark them? Use Twitter search to find things later?

I recently stumbled across Twitter Search on Bing. The absolute best thing about this is how it automatically lists the most tweeted links. Combining this with search allows me to see who’s blog posting, article, whitepaper, etc. is the most popular. Here’s a screenshot of a #SharePoint search:

image

Now if they’d integrate the inline preview you get in a regular bing search, it would make this even more awesome.



Office 2010 Cool Feature &ndash; Insert Screenshot in Outlook

clock July 15, 2009 15:44 by author jay

When you’re composing a message in Outlook 2010, now you can quickly insert a screenshot of all the current open windows right from the ribbon as shown below:

insert screenshot in outlook

This will be a timesaver in so many ways. Kudos to the team for a simple, and useful feature.



b3icknfd4s

clock July 15, 2009 15:41 by author jay

b3icknfd4s



Unable to set ControlSize Property on RibbonToggleButton

clock June 9, 2009 03:57 by author Jay

I wanted to put a large toggle button on my custom ribbon similar to the Print Layout button that appears in the Document Views group of the Word View tab.

document views group

When I added a ToggleButton to my custom tab in the VSTO ribbon designer, I get something like the following:

custom group

In the picture above, the two buttons surrounded by the dotted line are two ToggleButton controls side-by-side with an image set.

Looking at the ToggleButton properties, there is no ControlSize property which is the property I believe would style the button like the Print Layout button.

button props

I’ve also tried setting via code to no affect.

I’m researching the issue and will hopefully post a solution soon.

SOLVED: If you put the ToggleButton controls in a ButtonGroup, the ControlSize property doesn’t apply.



Dual Booting Windows 7 and Windows 2008 for Demos

clock May 18, 2009 10:14 by author Jay

I recently tried to prep for a demo. I was given a VPC that I tried loading up on my 32-bit Vista laptop. Not so fast. The VPC guest is a 64-bit Windows Server and wouldn’t load up on a 32-bit host. Ok, so I’ll switch over to my 64-bit Vista home PC. Not so fast again. Virtual PC doesn’t run on a 64-bit host. In this case, VMware Converter and VMware Server saved the day, but I still needed a better solution.

I figured it was time to upgrade my work laptop to Windows 7, especially now the Release Candidate is available. But I also need to be able to run virtual machines, so clearly Windows Server 2008 R2 is a better choice as I’ll be able to use Hyper-V. (Of course, I have a bunch of VPCs that aren’t compatible but that’s a battle for another day.) Since I want to use Windows 7 as my daily driver, I figure why not dual-boot.

My research turned up a post by Keith Combs from MS that pretty much did exactly what I wanted to do, but I started with Windows 7, whereas he started with Windows Server 2008.

My ThinkPad T61P laptop had the following configuration:

Hard drive 1

  • System Partition (Windows 7) c:
  • Data Partition e:

Hard Drive 2

  • System Partition (Windows 2008) d:

I first installed Windows 7 to c:. Using the handy example in Keith’s post, I used http://catalog.update.microsoft.com to download drivers for the NVIDIA Quadro FX 570M in my laptop. I’m still without some drivers but I’m not sure what device they’re for yet. Lenovo has setup a Windows 7 Beta driver page at www.lenovo.com/windows7beta, but there’s not much there yet.

I then installed Windows 2008, mounting the ISO from within Windows 7. I selected the appropriate partition (note, I had other data on the partition that wasn’t disturbed by the process) and let Windows install. It added Windows 2008 to the boot menu and I was able to finish the setup largely as Keith did.

At this point, everything works as expected, I can dual boot to each respective OS, and files are available from either one. To further configure the setup to work the way I want it to, I opened up a command prompt as an Administrator and used bcdedit to change the default OS to Windows 7. That way I won’t have to worry about booting up Windows 2008 unless I really want to.

One great tip was found in Keith’s blog comments. Robert Larson has a post on his blog explaining how to use the Windows 7 drivers installed to c: in my case to update missing drivers installed inside of Windows 2008.

I’m hoping this setup will give me much of the flexibility (as well as power) to run my demos. One other approach I’m looking at is directly booting into a VPC. Unfortunately, I’m pretty sure that needing to run sysprep on the guest virtual machines will run havoc with all the other software that’s currently configured in them, but I’ll post when I confirm if it works or doesn’t.

I’ll have to say that it’s been a long time since I’ve done dual boot, vastly preferring using virtual machines for the last several years. It was an extremely pleasant experience loading up two different OSs, getting them to dual boot without any third-party software and on a notebook, and in relatively quick order. I’d estimate this entire process took about 1.5 hours, if I exclude all the other software I loaded up in Windows 7.



Url Collision when Installing SQL Reporting Services in Integrated Mode

clock May 12, 2009 09:39 by author Jay

In doing my first SQL Reporting Services install, I hit a snag. Using all of the SQL installation defaults, SQL Reporting Services requires two urls:

If you have SharePoint installed and you use the default Intranet Portal template, you’ll get a url collision because the template creates a subsite called Reports. SharePoint will never get a chance to process any requests to http://servername/reports because the Reporting Services Report Manger will get it first. This issue is described in detail at http://technet.microsoft.com/en-us/library/bb630449.aspx

The solution I used is described in the above web page which is to specify a different url for Report Manager:

  • Start the Reporting Services Configuration tool and connect to the report server instance.
  • Click Report Manager URL.
  • Specify the virtual directory. I changed it to http://servername/reportmanager

Voila, MOSS now can handle requests to the Report Center site using the url http://servername/reports.



Creating Word Building Block Footers

clock April 23, 2009 16:56 by author Jay

I’ve been trying to create some building blocks for a new template I’m building. One of the things I needed to do is be able to swap footers. I’ve tried a couple of methods which I’ll blog about later, but the method leading to this blog post was deciding to use the out-of-the-box Footer Quick Part functionality.

The first thing I did was simply create a custom footer, select all the text and then save it to the Quick Parts Gallery. I created a new document and inserted my customer footer from the Gallery. Hey, it did exactly as I expected it to do. Since the overarching functionality I need is to be able to swap footers, I selected another footer from the Footer Gallery.

What happened is it just added the content of the other footer to my custom footer already at the bottom of the page. Definitely not what I expected. So, I delete the footer from my page and insert one directly from the Footer Gallery. Then I pick another footer from the Footer Gallery. Sure enough, when swapping between different footers from the Footer Gallery, they replace each other.

So, if you want to actually create a custom footer, be sure to save it to the actual Footer Gallery. Apparently Word is doing some special processing when inserting items from this gallery, and presumably some of the others, that it doesn’t do with other Building Blocks.



Why is this so hard? Changing the default namespace in a VSTO project

clock April 2, 2009 18:21 by author Jay

Ok, so I’m getting back to development after a hiatus and decided to tackle a Word add-in for my company. It’ll really help me to be productive when I get it done so I figure it’s worth a little bit of investment on my part.

I go and fire up Visual Studio 2008 and create a new Word Add-in project. Give it a name and when I look at the namespace I see:

image

This is the name of my project. When I go to change it via Project Properties I see:

image

Ok, this is odd. The Root namespace property is disabled and is set to the sane name as my project file. Doing some quick searches I find that VSTO disables your ability to change the namespace. You need to name your project with the name you want to use for your namespace.

Well, I found someone that make have a workaround here. Haven’t tested it yet, so I can’t confirm it does as expected.



About the author

Something about the author

Tag cloud

    Page List

    Sign in