powershell 来自http://sharepoint.stackexchange.com/questions/144110/powershell-get-permission-on-spsit
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell 来自http://sharepoint.stackexchange.com/questions/144110/powershell-get-permission-on-spsit相关的知识,希望对你有一定的参考价值。
#Add SharePoint PowerShell SnapIn if not already added
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
#Define variables
$site = Get-SPSite "http://<site collection>"
#Get all subsites for site collection
$web = $site.AllWebs
#Loop through each subsite and write permissions
foreach ($web in $web)
{
if (($web.permissions -ne $null) -and ($web.hasuniqueroleassignments -eq "True"))
{
Write-Output "****************************************"
Write-Output "Displaying site permissions for: $web"
$web.permissions | fl member, basepermissions
}
elseif ($web.hasuniqueroleassignments -ne "True")
{
Write-Output "****************************************"
Write-Output "Displaying site permissions for: $web"
"$web inherits permissions from $site"
}
#Loop through each list in each subsite and get permissions
foreach ($list in $web.lists)
{
$unique = $list.hasuniqueroleassignments
if (($list.permissions -ne $null) -and ($unique -eq "True"))
{
Write-Output "****************************************"
Write-Output "Displaying Lists permissions for: $web \ $list"
$list.permissions | fl member, basepermissions
}
elseif ($unique -ne "True") {
Write-Output "$web \ $list inherits permissions from $web"
}
}
}
Write-Host "Finished."
$site.dispose()
$web.dispose()
$unique.dispose()
以上是关于powershell 来自http://sharepoint.stackexchange.com/questions/144110/powershell-get-permission-on-spsit的主要内容,如果未能解决你的问题,请参考以下文章
powershell 添加和删除Windows存储来自Powershell / CMD的应用程序
powershell 从文件加载Powershell函数。来自http://stackoverflow.com/a/6016630/1678525
powershell 从文件加载Powershell函数。来自http://stackoverflow.com/a/6016630/1678525
powershell 来自https://stackoverflow.com/questions/1663748/powershell-analog-to-quote-words
使用来自 Textfile 的文件创建 7-Zip 存档 - Powershell
管道文件到 uglifyjs - 来自 Powershell