編寫XML我有一個腳本,讓所有的信息,我需要我的SharePoint場:使用PowerShell
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$websvcs = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
$webapps = @()
foreach ($websvc in $websvcs) {
write-output "Web Applications"
write-output ""
foreach ($webapp in $websvc.WebApplications) {
write-output "Webapp Name -->"$webapp.Name
write-output ""
write-output "Site Collections"
write-output ""
foreach ($site in $webapp.Sites) {
write-output "Site URL --> -->" $site.URL
write-output ""
write-output "Websites"
write-output ""
foreach ($web in $site.AllWebs) {
write-output "Web URL --> --> -->" $web.URL
write-output ""
write-output "Lists"
write-output ""
foreach ($list in $web.Lists) {
write-output "List Title --> --> --> -->" $list.Title
write-output ""
}
foreach ($group in $web.Groups) {
write-output "Group Name --> --> --> -->" $group.Name
write-output ""
foreach ($user in $group.Users) {
write-output "User Name --> --> --> -->" $user.Name
write-output ""
}
}
}
}
}
}
我想使輸出到一個XML文件,然後將XML文件連接到HTML,使它的經理使用的網站
我該怎麼辦?
感謝您的幫助!
這不會幫助。嘗試過它 – alex
如果有人想證明xml是 - 與他們所說的相反 - 不是人類可讀/可寫的,那麼真的很好的代碼。 – TNT