Solved

Create a sharepoint site and add an owner using code

Posted on 2011-03-09
6
793 Views
Last Modified: 2012-05-11
I need to write some code to create a sharepoint site, create a specific Member, Visitor, and Owners group and add a user to the owner's group.
I have the code to create the site, but I can't figure out how to create the 3 groups and add a user to one of the groups.
Thanks
Ron
0
Comment
Question by:Capt_Ron
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:sabby447
ID: 35089623
0
 
LVL 1

Author Comment

by:Capt_Ron
ID: 35089649
Do you know of a version of this using VB or C#?
0
 
LVL 6

Expert Comment

by:sabby447
ID: 35089687
Not in total however here is a pointer which may help you : http://www.codekeep.net/snippets/0301b30a-cdf9-4dd2-bbd0-0be4ad6c1a90.aspx 
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 6

Accepted Solution

by:
sabby447 earned 250 total points
ID: 35089690
Some more :

http://sarangasl.blogspot.com/2009/12/add-user-to-sharepoint-user-group.html
http://msdn.microsoft.com/en-us/library/ms412944.aspx

I will try in my environment as well to see if this works .. Just sharing to get you started as well
0
 
LVL 14

Assisted Solution

by:KoenVosters
KoenVosters earned 250 total points
ID: 35092133
You have to use the SpGroup class:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spgroup.aspx
Adding users is done with the AddUser method:
http://msdn.microsoft.com/en-us/library/ms454048.aspx
0
 
LVL 1

Author Closing Comment

by:Capt_Ron
ID: 35201645
Between the two, I was able to figure it out.  Thanks.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Scenario: Let’s say you have a quote worksheet in Excel that you use to work up sales figures and such for your clients. You utilize SharePoint to manage and keep track of these documents. You would like values from your worksheet to populate Sh…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question