locked
Assigning a group to a sharepoint role via stsadm (moss2007) RRS feed

  • Question

  • Hi

    On our Sharepoint 2007 server, in a particular site collection, I have a bunch of users added to a group called 'staff'. How can I assign this group to Sharepoints internal 'designers' role using Powershell.

    I thought that something like:

    stsadm -o userrole -url http://site -userlogin domain\user -role design

    might do the trick, but this only returns user not found, even though if I try to add the role to the user with the UI the account is there and can be added without any problems.

    Any thoughts anyone?

     

    Regards

    Gary

    Friday, November 19, 2010 2:10 PM

Answers

  • Hi Gary,

     

    I have a test with an AD security group called “Group1” on my MOSS 2007 SP2, what I found is that I was unable to add a group directly to a site permission level via stsadm –o userrole command line unless it has previously been given permissions on that site. I added “Group1” to a permission level on a site for the first time using stsadm -o userrole, but I got the error message “User cannot be found”, trying to add the role through the UI came out with success though. Then, I use stsadm –o adduser, operation complete successfully and Group1 has been added to the permission level I specified in the command. After that, I can modify the permission level to Group1 using stsadm -o userrole.

     

    Seems that stsadm –o userrole can only be used to modify the permissions of a user or group that already is assigned permissions on a site. To directly add a user or a group to sites permissions you might need to use stsdam -o adduser.

     

     

    Hope it helps.

     

    Thanks & Regards.

     

     

    Lily Wu

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com


    Lily Wu
    Monday, November 22, 2010 6:04 AM

All replies

  • Monday, November 22, 2010 3:06 AM
  • Hi Gary,

     

    I have a test with an AD security group called “Group1” on my MOSS 2007 SP2, what I found is that I was unable to add a group directly to a site permission level via stsadm –o userrole command line unless it has previously been given permissions on that site. I added “Group1” to a permission level on a site for the first time using stsadm -o userrole, but I got the error message “User cannot be found”, trying to add the role through the UI came out with success though. Then, I use stsadm –o adduser, operation complete successfully and Group1 has been added to the permission level I specified in the command. After that, I can modify the permission level to Group1 using stsadm -o userrole.

     

    Seems that stsadm –o userrole can only be used to modify the permissions of a user or group that already is assigned permissions on a site. To directly add a user or a group to sites permissions you might need to use stsdam -o adduser.

     

     

    Hope it helps.

     

    Thanks & Regards.

     

     

    Lily Wu

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com


    Lily Wu
    Monday, November 22, 2010 6:04 AM