Saturday, January 1, 2011

ProfileManager.LoadUserProfile fails

I needed to have a .NET component in Component Services run as another user, then call

ProfileManager.LoadUserProfile within the code.

It fails. I found this:

http://marianosz.blogspot.com/

Which pointed me in the right direction - the user has to be loaded first by the component, then it will work.

So, I right clicked on the component and said Start - the call now works.

But how to start a component without doing this manually?

So, I turned it into a windows service that starts up automatically (from the Component Services manager)

However, when I rebooted, it said Service did not start, logon failure. Had to go into services and reenter the password for the user.

Now it works.

No comments:

Post a Comment