powershell 用于Web应用程序的Inventory SharePoint解决方案。这些文件中的每一个都搜索不同类型的解决方案及其用途。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell 用于Web应用程序的Inventory SharePoint解决方案。这些文件中的每一个都搜索不同类型的解决方案及其用途。相关的知识,希望对你有一定的参考价值。

$w = get-spweb http://spsvde001
foreach($list in $w.Lists)
{
    if($list.BaseType -eq "DocumentLibrary")
    {
        foreach ($item in $list.Items) {
            $file = $item.File
            if($file.name -like "*aspx"){
                $url = $file.ServerRelativeUrl
                $fileUrl = $file.ServerRelativeUrl
                $manager = $file.GetLimitedWebPartManager([System.Web.UI.WebControls.Webparts.PersonalizationScope]::Shared)
                $wps = $manager.webparts
                $manager.Dispose()
                foreach($wp in $wps)
                {
                    if($wp -like "*Advance*"){
                        $url
                        $wp.WebBrowsableObject.Title
                    }
                }
            }
            #$wps | ft WebBrowsableObject #| select-object @{Expression={$file.Web.Url};Label="Web URL"},@{Expression={$fileUrl};Label="Page URL"}, DisplayTitle, IsVisible, @{Expression={$_.GetType().ToString()};Label="Type"}
        }
    }
    
}
foreach ($file in $web.Files) {
    if($file.name -like "*aspx")
	{
		$url = $file.ServerRelativeUrl
        $fileUrl = $file.ServerRelativeUrl
        $manager = $file.GetLimitedWebPartManager([System.Web.UI.WebControls.Webparts.PersonalizationScope]::Shared)
        $wps = $manager.webparts
        $manager.Dispose()
        foreach($wp in $wps)
        {
			if($wp -like "*Advance*")
			{
				$url
                $wp.WebBrowsableObject.Title
            }
		}
	}
}
$webApplicationName = ""
$searchPhrase = "filteredlookup"
$cnt = 0
$wa = Get-SPWebApplication()
foreach($site in $wa.Sites)
{
    foreach ($web in $site.AllWebs) 
	{
        foreach($list in $web.Lists)
        {
			$listURL = $list.RootFolder.Url
            foreach($item in $list.items){
                $itemTitle = $item.fields | ?{$_.fieldrenderingcontrol -like '*$searchPhrase*'} | ft Title
                if($itemTitle -ne $null){
                    #"Item Title: " + $itemTitle
                    $web.url + "/" + $listURL
        			$cnt++
                }
                break
            }
		}
	}
			
}
"Count:"
$cnt

以上是关于powershell 用于Web应用程序的Inventory SharePoint解决方案。这些文件中的每一个都搜索不同类型的解决方案及其用途。的主要内容,如果未能解决你的问题,请参考以下文章

用于帮助台的我的 Powershell 脚本的 Web 前端

powershell 用于Web应用程序的Inventory SharePoint解决方案。这些文件中的每一个都搜索不同类型的解决方案及其用途。

如何使用 PowerShell 远程检查 Web 应用程序池的状态?

如何在没有管理员权限的 Azure Web 应用上安装 PowerShell 模块?

无法在 IIS 托管的 .net web api 项目中运行 powershell 脚本

powershell 此SharePoint Powershell脚本会检查网站集和Web应用程序中的所有网站,以查找特定的Web模板