Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Create document library via a stored procedure?

  Asked By: Bob    Date: Aug 15    Category: Sharepoint    Views: 1750

Does anyone know of a stored procedure, or any other SQL way, to create a document library in SPS 2003? Normally it wouldn’t be a problem because it could be coded using any of the many programming methods BUT our Portals are CAC enabled and that means that we cant use a system or service account to impersonate and create. It would have to be something that could be done with SQL. If I haven’t explained in enough depth or properly please don’t hesistate to ask for more clarification. I’m not the actual coder and I’ve explained as well as I could without getting in touch with him again. My own search has turned up many ways to do it with code but that doesn’t satisfy his requirement.



7 Answers Found

Answer #1    Answered By: Patricia Richardson     Answered On: Aug 15

Why can't you impersonate? You should be able to write an application that runs n the portal and impersonates a service account.

Answer #2    Answered By: Alexandra Patterson     Answered On: Aug 15

To my understanding the problem lies in the cac authentication Every
id has to have a certificate or there is no access. This is one of
the reasons why crawls dont work on CAC enabled portals. They, in my
case meaning the government, are working on a means of providing CAC
certificates to service IDs but until then we have to work around
this issue.

Answer #3    Answered By: Christop Mcfadden     Answered On: Aug 15

You are talking about user required CAC. We currently have our portal servers not provisioned for CAC since all of the PCs on our network require CAC logon. Users connecting to the portal are authenticated through AD but the local system accounts still work on the server.

Answer #4    Answered By: Stefanie Ruiz     Answered On: Aug 15

Impersonation via vb.net is 100% ruled out in the
environment which leaves only three possible ways to
do this that I know of (Web services will not work)...

1) CAML out of the page...
2) RPC somehow out of the page...
3) Some vba technique that I have been unable to find
4) Within SQL itself, fraught with peril and ill
advised, but very rich in potential...

Answer #5    Answered By: Damon Garner     Answered On: Aug 15

You have two contracts to SharePoint. The object model and the web services.
Both will create  a document  library for you. I don't know about CAC nor do I
understand why a piece of code running on the server could not do this. I
personally would not attempt another way around it like inserting into the
database directly (stored proc or otherwise). If you want you can get your
programmer to email me privately to explain why CAC prevents a code
solution. SharePoint itself is .NET code (for example when you create a
document library  through the UI) so your own code can do the same thing if
it's doing it now.

Answer #6    Answered By: Royce Orr     Answered On: Aug 15

The problem is that apparently a vb.net program on the
server would need to impersonate an account in order
to pass through the security barrier. Perhaps there is
some way a web part can pick up the security of the
current user by context and allow it to work that way,
but that is not immediately apparent.

Also if I understand correctly, any vb.net code would
need to be registered into the GAC.

Frankly, code that would sit in an ASPX file at the
_bin, and create  a Document Library from a name in a
text box on a page when called by a javascript would
be very handy.

In the meanwhile a spot of CAML or RPC that comes out
of Javascript would get me most of the way...

Answer #7    Answered By: Laura Walker     Answered On: Aug 15

Impersonating the existing (current) user is drop dead simple in a web part.
Impersonating the application pool or even a named user (with the
userid/password stored  somewhere and optionally encrypted) is pretty basic
stuff too. So I don't see what the problem is (maybe the developer doesn't
know how to do this?)

The statement that any .NET code (VB.NET or otherwise) has to live in GAC is
false. It can happily live in the bin directory under the website folder (or
various other places).

Didn't find what you were looking for? Find more on Create document library via a stored procedure? Or get search suggestion and latest updates.

Related Topics:



Related Post