I wrote a powershell script and I would like you to varify if it is a good one.

So the goal of this script is that it will retrieve a specific site and will modify the name of a persmission level, so the permission shouldn't be adjusted only the name.

The thing is I have a permission with a strange name there, so I need to update it to a more reasonable name.

Here is the code that I have:

function ModifyPermissionForSite()
{
    $site=get-CsWebAppUrl()+"/SiteName"
    $web =site.RootWeb
    $roleCollection=$web.RollDefinitions
    $role=$roleCollection["Auto-generated Permission Level"]

    $role.Name="New Persmission level name"
    $web.Upate()
    Write-Host "$($role) is updated to a new value!" -ForegroundColor green
}
link|improve this question

17% accept rate
Sorry, but this is not really a question in its current form. You need to ask a specific technical question, and please make it as clear as possible what you are trying to do. Perhaps you could just ask how to systematically modify a set of permission levels in PowerShell (possibly including code to show what you are trying to do if it helps). The question will be closed for now, but don't worry - once you have improved the question flag a moderator and it can be reopened. See our FAQ for general guidelines. – SPDoctor Jan 26 at 23:20
feedback

closed as not a real question by SPDoctor Jan 26 at 23:22

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. See the FAQ for guidance on how to improve it.

Browse other questions tagged or ask your own question.