Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

My share-point 2010 experience is limited but I can follow clear instructions.

Can someone explain step by step how can I open people picker through hyperlink and add those people as site collection administrator.

I have created a site definition for creating site collections. It's like an administrator can create a blog. There I have a hyperlink to edit/add administrator. So there I have to open a people picker and add those people as site administrator.

Any help is appreciated.

Thanks. :)

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You can add a link to _layouts/mngsiteadmin.aspx. This is the page which is used to manage site collection admins.

But....

  1. Why not use the built in Site Actions -> Site Settings Menu?
  2. What did you mean by Admin? Blog owners? Editors?

You can also write your Visual Webpart to show People Picker and add/edit Adminstrator programatically.

Edit:

You can use SPUser.isSiteAdmin to set Site Admin. This is okay if you just want to add a new Site Admin. You have to use a People Editor and get the list of slected users and use the above property to add new Site Admin. But when it comes to editing existing administrators you will have to fetch them and give the option to remove if required.

share|improve this answer
    
Hi Shoban, for your 2nd question it's like you can say it's a blog owner. I have to add blog owners in it through code. I can't go to site actions and add users as administrator. I have to do it through code. –  Ankit Jun 8 '11 at 5:38
    
@Ankit edited. please check –  Shoban Jun 8 '11 at 5:52
    
@Shoban: Thanks for your valuable comment. That is the exactly what i want to implement in my code. But unfortunately I am having very limit knowledge on sharepoint. I have started working on it recently. If you don't mind could be please tell me that how can do this part (removing and adding site administrator). A small code sample will be highly appreciated. –  Ankit Jun 8 '11 at 6:26
    
sharepoint.stackexchange.com/questions/9009/… see this question. It hasd a sample code. Check out! try and come back here if you have questions. –  Shoban Jun 8 '11 at 6:28
    
Just noticed!! You asked that question!! please do not post multiple versions of same question. Flagging to merge it together. What have you tried so far? –  Shoban Jun 8 '11 at 6:29
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.