Question [Sharepoint] Suppression autorisation SPSiteGroups

Plus d'informations
il y a 13 ans 2 mois #13540 par Jean bilal
Bonjour,

Je souhaiterais supprimer via powershell des autorisations pour certains groupes.

Voici le concept du code (mode light) :

[code:1]$spsite = new-object Microsoft.SharePoint.SPSite(\"$site\"«»);
$web = $spsite.rootWeb
$SPGroup = $web.SiteGroups
foreach ($group in $SPGroup)
{
$group.Remove($web.RoleDefinitions[\"Lecture\"]);
$group.update()
}[/code:1]

J'aimerais enfaite pouvoir supprimer l'autorisation de lecture pour un groupe mais je n'ai rien trouvé à ce propos dans les technet.

En effet, il y a la solution pour ajouter une autorisation à la création d'un groupe mais il n'y a aucune info pour supprimer une autorisation au sein d'un groupe existant.

Auriez vous des infos à ce propos ?

Merci bien

Cordialement<br><br>Message édité par: jbilal, à: 7/01/13 15:23

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 13 ans 2 mois #13543 par Matthew BETTON
Bonjour,

Je ne connais pas assez Sharepoint...

Peut être une piste ici .

Voir notamment la fonction : Remove-SPPermissionFromListGroup

@ +

Matthew<br><br>Message édité par: Matthew BETTON, à: 7/01/13 16:52

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 13 ans 2 mois #13545 par Jean bilal

$list = $web.Lists.TryGetList($ListName)


Le HIC est que TryGetList n'est pas reconnu sous Sharepoint 2007 mais seulement sous 2010/2013 :(

Si quelqu'un aurait l'équivalent sous Sharepoint 2007, je suis preneur :/

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 13 ans 2 mois #13546 par Laurent Dardenne
jbilal écrit:

Si quelqu'un aurait l'équivalent sous Sharepoint 2007, je suis preneur :/

Consulte MSDN et personne d'autre ;)
S'il n'existe pas de cmdlet, utilise les API dotnet.

Tutoriels PowerShell

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 13 ans 2 mois #13547 par Matthew BETTON
Peut être une réponse ici :

rmanimaran.wordpress.com/2011/03/29/chec...and-sharepoint-2010/

While using Object model in SharePoint 2007 we use to check the existence of a List using the SharePoint List Collection as below.

[code:1]
1 SPList myList = web.List[\&quot;Sample List\&quot;];[/code:1]


In the above case if the specified list is found, then the corresponding list object get loaded in myList variable. But if the list does not exist, in that case it will throw Argument Exception. To get rid of this we use to have try-catch section to handle the exception.

Connexion ou Créer un compte pour participer à la conversation.

Temps de génération de la page : 0.101 secondes
Propulsé par Kunena