Showing posts with label Errors. Show all posts
Showing posts with label Errors. Show all posts

Thursday, June 26, 2008

Creating MySites Programmatically

Instead of asking every user to click on "My Site" and have the site provisioned for them it's sometimes nice to already have the site created... or create it as part of the Employee Intake process. This is especially true if the My Site plays a role in a custom application as it did for one of my clients.

Here's a snippet to get you started:


using (SPSite site = new SPSite(url))
{
UserProfileManager profileManger = new UserProfileManager(ServerContext.GetContext(site));
UserProfile profile = profileManger.GetUserProfile(@"domain\user");
profile.CreatePersonalSite();
}


However, I kept getting the following error message:
You do not have access to create this personal site.

Now.. I'm an admin on the box and within SharePoint but it turns out you will see this error if your user does not have access to Shared Services. You'll either need to impersonate a higher user using SPSecurity or, in my case, simply right click on your command line application and choose "Run as..." and enter the credentials for your Shared Services administrator.

Thursday, December 20, 2007

DCOM Errors

This is an issue that I've ran in to multiple times now. I haven't figured out the exact reason that these problems start occurring but it seems to be related to running Windows Update.

Here's the issue:

You'll start seeing lots of DCOM errors in your System Log, usually one every minute or so. These errors will look something like this:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{INSERT_GUID_HERE}
to the user DOMAIN\MOSSService SID (INSERT_SID_HERE). This security permission can be modified using the Component Services administrative tool.Basically your MOSS Service account doesn't have the necessary permissions to one of the DCOM services. So let's fix that.

  1. Go to Start > Run. Type "regedit". Click OK.
  2. Select the root node "My Computer".
  3. Select Edit > Find. And paste your GUID from the error in your system log into the search box and click "Find Next". Keep searching until you have a folder on the left and not the actual GUID itself.
  4. Now you know the name of the service that's lacking permissions in my case it was OSearch.
  5. Now go to Start > Administrative Tools > Component Services > Expand Component Services > Expand Computers > Expand DCOM Config
  6. Right click the service you found in my case "OSearch" and choose properties.
  7. Select the "Security" tab.
  8. Under "Launch and Activation Permissions" click "Edit..."
  9. Add your MOSS Service Account and ensure that he has both "Local Launch" and "Local Activation" permissions.
Now you can back up and clear your event log and enjoy an error free event log once again.