The Parameter is Incorrect

So, I could get neither xCopy nor BlueDog's DavCopy to work so I had to revert to brute force.

The problem is that UNC paths can use goofy characters like &, #, ~, ,, and . and URL paths can't.  So when, in some file share, you've got a file named "Snakes & Arrows.doc" when you try to upload that to a doc library you get the error "The Parameter is Incorrect."

We also run into this error when a file type is on the Firbidden File Types list in Central Admin and when we get a ~AAA9999.tmp file like when Word or Excel is auto-saving a draft, although I'm not sure why one would be left on the file share unless Word exits abnormally.

Now, we had over 15,000 documents in 2700 doc libraries.  So we went to scrubbing file name using a combination of the DOS Dir command, Notepad, Excel and DOS batch files.

First, for example, to find all the files with an & in the filename, we mapped a drive, L:, to the target file share and ran this from a command prompt:

DIR L:*&*.* /S /B /N >c:and.txt

That creates a file in the root of your c: drive named and.txt and it will list all the files and all the folders on the L: drive with an & in the file name.

Open the text file and copy and paste the content into Column A of an Excel worksheet.

Now, you have to use Excel string magic to remove one layer of directories labels at a time. So, in Column B, use this formula:

=IF(ISERROR(FIND("",A1,1)),A1,REPLACE(A1,1,FIND("",A1,1),""))

Then repeat that formula in subsequent columns to the right until you're left with a column with only the file names; this will depend on how deep your folders nest.  Copy the column of file names and use Paste Special | Values to paste the values, not the formulas, into a column of a new worksheet.  Then, on this worksheet, execute a find and replace, replacing the & with the string "and".

Copy the modified column and paste it back on the original worksheet in the next available column; if your original directory had folders as many as five layers deep, Column H would be good.  So, now, you've got the original DIR output in column A and the scrubbed file name in column H. Move over to column I and use this formula.

=CONCATENATE("REN """,A1,""" """,H1,"""")

This formula creates a text string that looks something like this:

REN "L:MyFolder01MyFolder02Snakes & Arrows.doc" "Snakes and Arrows.doc"

Now, copy the cells on row 1 and paste them all the way down to the end of your list. (Don't bugger your column H, the one with the new file names.)  Then copy Row I, the one with all the REN statements and paste them into Notepad and save the file as and.bat.  Find it in Windows Explorer and double click on it.  If you want, you can run it from a command line and append a >andout.txt; that will give you a nice output file for figuring out what you've done.

One thing about this process is this:  If you've got an & in a folder name, the folder will get renamed first and then the files will return a "file not found" error.  You'll have through the whole process again.  Of course, you could fight through the spreadsheet and make the folder name changes last but that would be burdensome.

And, finally, once you've scrubbed away all the &'s you'll have to find the #'s, the ,'s and any other goofy character.  The ~'s are particularly difficult to find since I don't think DOS will find them; perhaps if we knew the appropriate escape method to actually find a file with a ~ in the file name we could. Finally, the dots, i.e. ., are only a problem when there's two of them at the end in front of the file extension like this: My Firm Inc..doc.

So we migrated 17,000 documents with all of these issues in just 8 about hours. I was dragging folders from one Explorer window to another where I had a drive mapped to my doc library.  The folders would take as much as 10 minutes to copy and, often, they would crap out because of a .tmp file or some file I had missed; the ~ files were real hard to find before they errored.  I learned that, typically, an Explorer click and drag copy routine will copy the files first and then the folders in reverse alphabetical order.  Regradless, I would often have to open a third Explorer window to search for the problem file without making the error boxes go away.  Fix the file name, or move it to a separate "problem" folder, and run the click and drag again.

So, at least for this robot, brute force wins out.

hth

-robot

 

MOSS 2007 Document Migration

So we've got about 150,000 legal documents to migrate into MOSS from a network file share.  Of course, the customer wants the document library to look just like the file share so I think, great, I'll just drag and drop the folders into Explorer View.

Well, no such luck.  First, Explorer View is a big fat Page Not Found error on my host.  I started the web client like Joel said yesterday and everything but no explorer view.

So I just create a network place for the doc library and I go to copy folders and, of course, it barfs everytime there's a special character in the file or folder name.

So that's got me looking for a better way to get these document migrated, something that will move the files without blowing up every time it hits an ampersand.

Since I'm an old robot (me and HAL9000 were school buds) I recall the first pc command I ever learned, dir, and it does alot more than make text fly by your command prompt. In fact, if you assume the network file share is mapped to L: then this one might be handy here:

L:>dir /s /b /-n >c:Files.txt

This will provide an alpahbetical list of all files in all folders in the network share.  Now, all that remains is copying the text into Excel and writing some string magic in excel to write a copy command that can get batched into 2500 MakeDir commands and 15,000 copy commands.  The MakeDir will acually create the folders in the document library.  The copy will copy the old file with the old file name to the new folder with a "URLHappy" file name, i.e. one with no characters that are prohibited in URLs.

Let's I bet this works. The only question I have is this…

Which is easier:

  • Writing an executable to do it.
  • Writing VBA in Excel to do it.
  • Just doing it in Excel?

-robot

Explorer View in WSS v2

Of course we all loved the Explorer View in SharePoint 2003.

But, sometimes it doesn't work.  And sometimes click-and-drag doesn't work.

Well, our new best friend Mark helps with some of this nonsense.  On his site, he describes the fact that the Explorer View requires the Web Client Service to be running.  You get to this service in your Services .mmc which is an Administrative Tool under your control panel.  Be sure the service is running and, just like that, your Explorer View springs to life.

hth

-robot

Flawless MOSS 2007 Install

OK People, we now have two new best friends.  If you are "All SharePoint All the Time" skip the first one covered in the next three paragraphs.

First of all, does anyone know who Chris Squire is?  He plays bass guitar for Yes, this robot's favoritest band of all time. At his website you can order a personally autographed updated multimedia "Fish Out of Water" cddvd for $50 that includes a remastered version of his '70's solo album and a number of videos and other extras.

So, I ordered mine and it involved a number of eMails back and forth regarding format and paypal and they all were "from" Chris Squire.  So I thought, sure and then, finally, there was a question, "what would you like the autograph to say" and so I refered to a deep-cut phrase "42nd scream-down" from Tormato, the band's 1978 effort.

So the eMail comes back and he gives me two paragraphs about the bands lyrics and what they meant to him and how much he appreciated my indications of appreciation.  It really had to be him because, and of this I am certain, no robot or other human could have conceived of those words.  So, now, Chris is my best friend.  But I digress.

Our other new best friend is Ethan.

He hinted that the solution to my install woes might be found in two key activities:

  1. Build out the web sites first; one for portal, one for SSP and one for MySites.  Give them host virtual folders.  Use port 80 for all of them but give them unique host headers and .Net 2.0 support.
  2. Use a local hosts file to support demonstration of appropriate IIS routing prior to the MOSS install.

So this worked like money.  There was none of the ugliness of creating IIS web sites during the initial Central Administration tasks effort, no confusion over which server and port and application and app pool. Each of the three sites had an IIS web site standing ready to support it.  Created the AppPools on the fly and drive safe, thanks for coming.

So, using his hints, the table of content on my implementation plan goes like this:

Pre-Install Prep:

  1. Hardware
  2. Database Server
  3. Install Account
  4. Service Account
  5. Outgoing and Incoming EMail Accounts
  6. Portal Administrators

Install:

  1. Create Accounts
  2. Install .Net 2.0 and 3.0
  3. Secure License Key
  4. Create Host Virtual Folders for IIS Web Sites (Here, Ethan creates siblings to wwwroot for MySite and SSP. I created subfolders in wwwroot; an esoteric difference.)
  5. Modify HOSTS file to support the three host headers used in the three web sites.
  6. Create the new web sites in IIS configuring them to recognize the different Host Headers.
  7. Set the web sites to run .Net 2.0
  8. Run the CD.
  9. Set the eMail settings.
  10. Create the Web Applications.
  11. Assign Services to Servers.
  12. Create the SSP.
  13. Create the Portal.

EEEK Dorks!!!

Post Install:

  1. eMail your HOSTS file to your DNS guy
  2. Take the rest of the week off.

Frigging Munney!

I would be glad to share more details on this with anyone that will leave a polite comment.

Big thanks to Ethan and Chris and if you order the cddvd, be sure to tell him the 42nd Sream-down Tormato guy sent you.

Have a Sunny SharePoint Day!

-robot 

More on the 2007 Install

I've been chided for inadequate planning.  So, today, I plan to install 2007 again.

You guys that know me know that I don't see how that's inadequate.

Ok, maybe just a little more background.

In the past, I've gotten the software installed countless times.  Then I was on hiatus for a few weeks and, then, many of my previous blog posts were lost to the ether.  So right now, I'm just reminded how quickly I can get so stupid.

Here's what's happening, I get the software installed to where we get the central administration tasks.  And I've always tried to follow them explicitly.  But when I get to the Shared Service Provider part, it always wants to use my primary port 80 web site for the SSP.  When I go into "Create new web application" the machine starts to act weird, taking forever and then leaving me on some strange page, I forget the details.

So, our new best friend Ethan, dropped me a note that suggest working all of the IIS website stuff first.  His suggestion involves creating the IIS web sites for SSP and MySites, differentiating them by host headers, modifying the HOSTS file to support the host header names, and creating application pools and sibling folders to the wwwroot folder to virtualize their contents.  Then, when you're staring at Central Admin and you go to create your SSP, there's already a perfectly functional web site there to use.

Now, I've always liked to leave Default Web Site alone so that you could always prove IIS was okay dokey just by pulling up the Under Construction page in wwwroot.  However, bowing to the color of expertise, I'm going to try to follow his plan explicitly.

So, with that plan, off I go.  Wish me luck and I'll get you an update.

-robot

iDevFactory.com

I was recently asked by a manager with money to spend before the end of the budgeting quarter: "What third-party products can we buy today that will help us with our operation."  The part he didn't say was "that is currently planned three to six months out."

The only one I had used was CorasWorks and that was 2003.  While that was a great product, I've never used their 2007 products and I'm not sure they aren't suffering from the Microsoft disease where their "niche" gets rolled into the product sucking all the money with it.

I saw the Bamboo toolset and it helped with AD integration which is a real value ad as far as I was concerned.  I recall that 2003 and AD were kind of like the Hatfields and McCoys.  For those of you that care, SPS2003 was the Hatfields.

Now, I've seen the toolset from IDevFactory.com.  It seems interesting since it's "feature based" and as our 2007 environments get more complex, I imagine we'll be working hard to differentiate the word "feature" from "application" in the minds of our customers.

I'd love to hear anyone's comments about the IDevFactory toolset.  In the meantime, I've got to get one of my customers to let me install it and see if I can break it.

I hope everyone is having a Sunny SharePoint Day!

-robot  

 

Recovered: InfoPath Entries

Here's what I've been able to recover from some of my previous InfoPath entries that got ate in the crash:

More Frustration with the InfoPath Form Server

When I go to remove a form from the Manage Form Templates page, it shows as Deleting in the status column.  And it never goes away.

I restart the timer service. 

I run the stsadm.exe -o removeformtemplate

I reboot the server.

nothing.

But at least I can still work on other forms.  On this other guys server, everytime he tries to manage a form, he gets that "An item with a duplicate key has already been entered" error.

robot

 

InfoPath Form Server Form Deletion

We have the InfoPath Form Server version of SharePoint v3 running on a single server and we're trying to delete a form from the Manage Form Templates page in Application Management.

 When we hover and select Delete it give us a SharePoint error page that says:

An item with the same key has already been added.

I've got no idea what's going on here but, in the past, when we've had trouble with form templates, the template would indicate Deleting and never change and never go away.  We could run stsadm.exe -o execsvcjobs and the form would disappear.

This led me to believe it had something to do with some job service but I've never been able to figure out where or how to access any of that.  I find the Timer Job Definitions and the Time Job Status but I'be never been able to find anything that would idicate that a job is configured or runs that is intended to delete those form templates.

I got some help from the Yahoo Group that suggested the STSADM commands for forms were a little simpler that using the interface.  Those two command would be:

stsadm -o verifyformtemplate -filename "C:MyForm.xsn"
stsadm -o uploadformtemplate -filename C:MyForm.xsn.

So that would be cool except that I was getting the command line error when I tried to enter that value.  So I started looking for the STSADM help and I found some STSADM help here but it may be WSS v2.:

Then, our friend Todd related his experience with the OWSTIMER.EXE going crazy.  That seems like what I may have been looking at although we've rolled the server back and rebuilt it and the issue has not reappeared.

Now while STSADM might be an option for installing the form, I'm not sure where I get the overwrite, quiesce or extend functionality.

robot

 

Upload, Activate, Deactivate, Remove Form Templates

I get the stsadm command for uploading  form templates goes like this:

C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12BINstsadm.exe -o uploadformtemplate -filename C:MyFolderMyForm.xsn

But the -help activateformtemplate says this:

stsadm -o activateformtemplate
 -url <URL to the site collection>
 [-formid <form template ID>]
 [-filename <path to form template file>]

so we can go with formid or we can go with path and filename. 

Next, the formid is exposed when you view the form properties by hovering over the form on the Manage Form Templates and clicking on View Properties.

Of course, when we use stsadm.exe to upload the form, we have no way of knowing what the formid is.  Which brings us to -filename.  Can we activate using a path and filename to a site collection and have it still be the same form that's uploaded to the Manage Form form library?  I would guess not but I would also guess that there's doggone few people that know for sure so let's add to that count.

Yes, this is odd.  But, if you look at the form template properties in InfoPath designer, you'll see that it knows its form ID and, obviously shares that knowledge with the form template that's loaded into the form server.  That lets us use the -filename parameter just the same.

So your "No GUI" form management routine goes like this:

Verify:  

stsadm.exe -o VerifyFormTemplate -filename c:MyFormFolderMyForm.xsn  

Upload:

stsadm.exe -o UploadFormTemplate -filename c:MyFormFolderMyForm.xsn  

Activate: 

stsadm.exe -o ActivateFormTemplate -url http://MySiteCollection -filename c:MyFormFolderMyForm.xsn            

Deactivate:

stsadm.exe -o DeactivateFormTemplate -url http://MySiteCollection -filename c:MyFormFolderMyForm.xsn            

Remove:

stsadm.exe -o RemoveFormTemplate -filename c:MyFormFolderMyForm.xsn            

Remember, uploading and removing waits for the SharePoint Timer so make it work right now using:       

stsadm.exe -o exeadmsvcjobs

So you, me and all that we can tell now know that managing form templates is now a batch file.

robot

 

The Timer Service

OK, you guys are the greatest.  Our newest best friend Visuary actually joined our group so he could let us know:

I was experiencing the same issue, I went to Configure Infopath Forms Services and turned off SSL, allowed everything (checked all check boxes).  Then ran stsadm -o execadmsvcjobs and upon refresh the template was gone.  I then went back and put my settings back like I wanted them.

Which is great because we can try that right now.

On a second and slightly related issue, we seen the form status stuck on "Installing" or "Deleting" for what seems like an eternity, a condition to which our other newest best friend BrokenArrow refers to in his comment.  Now, apart from what your might think, I am capable of figuring out some things for myself, and this one is not one of those cases. 

But, I have found that when my form won't move out of Installing or Deleting status, I can turn off the windows time service, move the clock ahead an hour, reset IIS and run stsadm.exe -o execadmsvcjobs, then turn the windows time service back on and be sure it reset the computer's clock.  I wonder if this problem will go away after next weekend? 

It's funny how we were all spun up about Y2K and it was a dud but we completely overlooked this DST thing and it's been an "issue."

robot

 

An Item with the Same Key has Already been Added.

I saw this post:

http://weblogs.asp.net/erobillard/archive/2006/10/20/Resolving-the-MOSS-2007-error_3A00_-An-item-with-the-same-key-has-already-been-added_2E00_.aspx

I get this error in SharePoint Central Administration trying to remove forms from InfoPath Form Server.

I get it from a command line running stsadm.exe -o removeformtemplate -formid MyformID

Once I get it, I get it anytime I click OK in central admin.

This ends up with the server pretty much a total loss.

robot

 

InfoPath 2007 Form Options for Browser-Enabled Forms.

Published 10 January 07 04:27 PM | SPRobot 

Okay, InfoPath forms are really kind of cool.

I'm just using the Status Report template that installs with the Office 12 version and I'm running it on a browser.

Tools | Design this Form will take the form into design mode.

Tools | Form Options is a multi-page dialog box that provides a number of interesting oppotunities some of which impact publishing.  At this point maybe it's best to review them all and note those that are important to your publish routine.

  1. First, you have to go all the way to the bottom of the list and find Compatibility.  Here, you have to check the Design…Browser box and then enter your site's URL so that InfoPath can "verify" compatibility.  This URL should be to a SharePOint site, not Central Admin and it will actually call out to the formserivce.asmx that it finds in the site's \_vti_bin virtual folder.  When you click OK it will actually connect to the server and do something so give it a second while you read the Conencting to Server status indicator.
  2. Now that you've told the form it can expect to see service in a browser, the Browser page option will appear at the top of the list.  Here, you can specify the placement of the tool bar(s) and the action(s) that will appear on them.  The top bar has the Powered by InfoPath Form Services with the Office 12 Logo.  If you uncheck the top bar, the stupid logo will get pushed down to the bottom bar.  If you delete the top and bottom bar, you'll get a little white footer bar that says Powered by: InfoPath Forms Services in text.  I bet you could embed some custom in-line CSS to make that disappear.  As is, I'm rolling with the stupid logo and both top and bottom bars with just Close and Print View options.
  3. The Open and Save page give you some on screen options but I'm not sure they'll play in a browser.  You do get a little rule builder thingey to leverage the form open event.  Actions attached to the form save event is not supported in a browser so you get the polite little yellow panel explaining that Save using custom code is not supported in a browser.

  4. I'm not sure Offline is a great topic for browser-based forms but E-Mail Attachments is interesting because eMailing forms is a great option on same.  Here, if you can dot the data only, the data and the template or neither.  This means your targeted recipient can look at  the form in InfoPath when he or she gets it.  There's also eMail friendly forms that work alot like Lotus Notes where the functional form will appear in your eMail.
  5. Property Promotion is the familiar list of schema elements that will get poked out to metadata when it is written out to a SharePoint list.
  6. Digital Signatures are cool. I'll need to look at them in detail, but here, just note that, in a browser, you can only sign specific schema elements.  Apparently, you can't sign the whole form at once.
  7. Security and Trust is a great tab.  You'll need to refer to these as you run into trouble deploying more sophisticated solutions like custom code.
  8. The Programming  tab will let you drop in a custom task pane, which could be way cool, but then it warns you about Script and Code.  I think the "script" that it's talking about is the old VBScript or JavaScript that you can embed in IP forms.  Then you can hook up VB or C# code behind pages.
  9. Versioning is trivial.
  10. Compatibility we spoke of earlier.
  11. Advanced let's you treat null values as zeroes.  Cool

hth

robot

Recovered: RSS Feeds

SharePoint RSS Generator

OK, folks…

This rocks.  You can find your RSS feeds everywhere these days like Yahoo Sports here:

http://sports.yahoo.com/top/rss.xml

So all you need is that URL and this guy's killer site:

http://sharepointrss.com/

Click Generate and save it to a doc library and then you have in importable web part that will keep you up to date with all that going on in the world of sports.

That is so cool.

robot

Recovered: MOSS and Team Foundation Server

WSS v.3 and Team Foundation Server

Mike's blog makes a pretty strong  case for upgrading to WSS v.3 on your Team Foundation Server.  I've always wanted to get my TFS and My Project server to live inside my portal server as a top level site instead of as a seperate web collection  IIS web application but this is a good step.

http://bloggingabout.net/blogs/mglaser/archive/2006/12/05/Why-you-should-upgrade-TFS-V1-to-WSS-3.0.aspx 

 –robot

Recovered: MOSS Search

MOSS 2007 Search

So this guy comes up and says "search isn't working" and I say "oh?"

And I look, and, sure enough, I get nothing when I search for "robot"

So I get to the Shared Services Administrator and there, under Search, I see the Search Settings.  I guess these are different from the Manage Search Service on the Application Management page.

 So I click on Content Sources and Crawl Schedules and I schedule a crawl and check Start Now and another satisfied customer goes away happy.

I did notice, the Manage Search Service paeg, you get a Farm-Level Search Settings option where you can select

SSL Certificate Warning Configuration

Select this checkbox only if you trust that sites are legitimate even if their certificate name does not exactly match.
 
I'm guessing we'll need to uncheck that since none of our certificates match.
robot