RE: SharePoint



I got what I need working in a console app:

Using site As New SPSite(strSPSite)

Dim context As ServerContext = ServerContext.GetContext(site)
Dim profileManager As New UserProfileManager(context)

If Not profileManager.UserExists(accountName) Then
Dim profile As UserProfile =
profileManager.CreateUserProfile(accountName)
If profile Is Nothing Then
mmReturnMessage = mmReturnMessage & "Failed to
Create User with account :" & accountName & "<br />"
End If
End If
End Using

However, all sorts of wierd errors in a web app, even running under an
account pool with server admin priviledges. Tried using
SPSecurity.RunWithElevatedPrivileges but still errors (like can't process
request, please try again.. Property evaluation failed.... Operation is
not valid due to the current state of the object....)

Any idea what it takes to get this to run in a web app? Since the code runs
in a console app, it must be something to do with web priviledges. I even
tried setting the anonomous user to one with admin priviledges, but still got
errors.

I hope other SharePoint actions aren't as convoluted... will never get
anything done.

Thanks.

""Steven Cheng"" wrote:

Thanks for your reply Gerhard,

Yes, the sid used internally may have been somewhat mangled. I haven't
found any reference which explain the format. One thing I think you can
have a look is the UserProfileManager class of the MOSS object model(in the
Microsoft.Office.Server.dll).

The "CreateUserProfile" method in it has refered to some methods related to
sid generation, which might be helpful.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx


From: =?Utf-8?B?R2VyaGFyZA==?= <Gerhard@xxxxxxxxxxxxxxxx>
Subject: RE: SharePoint
Date: Thu, 4 Jun 2009 11:37:01 -0700


Glad you are feeling better, and I hope you stay healthy.

I have it pretty stably running now, with the only remaining call to the
web
service being on creating a new user. Looks like the stored procedure that
is used for that is profile_UpdateUserProfileBlobData passing the SID (from
a
trace I ran). However, it is being passed a SID that is different than the
windows SID. Is there a way to get/create the Sharepoint SID? Any other
way
to create a new user using a stored procedure so a call to a web service
would not be needed?

Take care.

""Steven Cheng"" wrote:

Hi Gerhard,

Sorry for the late response as I got a bad cold previous days.

As for the webservice issue, if you have other sharepoint server
environment, you can perform some tests on other server boxes to verify
whether the unstable behavior is consistent on all sharepoint environment
or just specific to this dev environment.

Currently, you can keep your current workaround, and I would also
recommend
try troubleshooting the original object model approach as that will be
much
more effecient than using webservice.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.


--------------------
From: =?Utf-8?B?R2VyaGFyZA==?= <Gerhard@xxxxxxxxxxxxxxxx>
Subject: RE: SharePoint
.



Relevant Pages

  • RE: SharePoint
    ... a Windows 2003 server with an admin account running it, ... sharepoint admin permissions that I shouldn't be running into this, ... this without error (like it runs in the console app)? ... Dim profileManager As New UserProfileManager ...
    (microsoft.public.sharepoint.portalserver.development)
  • RE: SharePoint
    ... \par So you have got the following code working in a normal console app, ... Is this web application a standalone ASP.NET web application or is it hosted in sharepoint site? ... \par> Thanks for your reply Gerhard, ... the sid used internally may have been somewhat mangled. ...
    (microsoft.public.sharepoint.portalserver.development)
  • RE: SharePoint and Company Web not working
    ... How did you install the SharePoint 3.0, side by side install or In-place ... If you made in-place upgrade for companyweb, you must uninstall SharePoint ... Select Windows Small Business Server 2003, ...
    (microsoft.public.windows.server.sbs)
  • Available share point developer consultant for your clients. projects. In vargina,. are any other l
    ... Office SharePoint Server 2007 with Windows SharePoint ... SharePoint Developer ...
    (microsoft.public.sharepoint.windowsservices)
  • RE: Problems upgrading SQL MSDE for Sharepoint
    ... I am glad to know the upgrade Sharepoint ... Microsoft CSS Online Newsgroup Support ... With this working I was able to start upgrading SQL MSDE for SharePoint. ... >white paper to backup your SBS server first. ...
    (microsoft.public.windows.server.sbs)

Loading