Solved

Create a sharepoint site and add an owner using code

Posted on 2011-03-09
6
770 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
Comment Utility
0
 
LVL 1

Author Comment

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

Expert Comment

by:sabby447
Comment Utility
Not in total however here is a pointer which may help you : http://www.codekeep.net/snippets/0301b30a-cdf9-4dd2-bbd0-0be4ad6c1a90.aspx
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 6

Accepted Solution

by:
sabby447 earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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.

Join & Write a Comment

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…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now