RE: SharePoint
- From: Gerhard <Gerhard@xxxxxxxxxxxxxxxx>
- Date: Fri, 5 Jun 2009 15:10:01 -0700
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,recommend
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
try troubleshooting the original object model approach as that will bemuch
more effecient than using webservice.Please
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.
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
- Follow-Ups:
- RE: SharePoint
- From: "Steven Cheng"
- RE: SharePoint
- References:
- RE: SharePoint
- From: "WenJun Zhang[msft]"
- RE: SharePoint
- From: Gerhard
- RE: SharePoint
- From: "Steven Cheng"
- RE: SharePoint
- From: Gerhard
- RE: SharePoint
- From: "Steven Cheng"
- RE: SharePoint
- Prev by Date: RE: SharePoint
- Next by Date: RE: SharePoint
- Previous by thread: RE: SharePoint
- Next by thread: RE: SharePoint
- Index(es):
Relevant Pages
|
Loading