Solved

Create a sharepoint site and add an owner using code

Posted on 2011-03-09
6
783 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

11 Experts available now in Live!

Get 1:1 Help Now