zoukankan      html  css  js  c++  java
  • sharepoint powershell 批量处理匿名访问

    配置Web Application启用匿名访问

    Add-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
     
    $webApp = Get-SPWebApplication 'http://sharepoint.crescent.com/'
    $webApp.IisSettings['Default'].AllowAnonymous=$true
    $webApp.update()

    配置单个网站启用匿名访问

    $web = Get-SPWeb http://sharepoint.crescent.com/sites/operations
    #Enabled -  lists and libraries; On - Entire web site ; Disabled - Self explanatory :-)
    $web.AnonymousState = [Microsoft.SharePoint.SPWeb+WebAnonymousState]::Enabled 
    $web.Update()

    配置某个网站集下所有网站启用匿名访问

    (Get-SPWebApplication http://192.168.30.75/ | Get-SPSite -Limit All | Get-SPWeb -Limit All | Where {$_ -ne $null -and $_.HasUniqueRoleAssignments -eq $true } ) | ForEach-Object { $_.AnonymousState = [Microsoft.SharePoint.SPWeb+WebAnonymousState]::On; $_.Update(); }

    配置某个列表或文档库启用匿名访问

    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
     
    $web = Get-SPWeb http://sharepoint.crescent.com/sites/operations
     
    $list = $web.lists.tryGetList("Documents")
    if($list -ne $null)
    {
    $list.BreakRoleInheritance($true)
    $list.AllowEveryoneViewItems = $true
    $list.AnonymousPermMask64 ="Open, OpenItems, ViewListItems, ViewVersions, ViewFormPages, ViewPages, UseClientIntegration"
    $list.update();
    }

    jindahao

  • 相关阅读:
    随笔2
    随笔
    关于updateElement接口
    随笔1
    本地访问正常,服务器访问乱码 记录
    Redis (error) NOAUTH Authentication required.解决方法
    tomcat启动很慢 停留在 At least one JAR was scanned for TLDs yet contained no TLDs.
    微信公众号消息回复
    微信公众号 报token验证失败
    idea中web.xml报错 Servlet should have a mapping
  • 原文地址:https://www.cnblogs.com/jindahao/p/4332655.html
Copyright © 2011-2022 走看看