3

$_ is your SPWeb object. Your script should look like this: $site | Get-SPWeb -Limit all | ForEach-Object { $Pages_Library = $_.Lists[$lookForList] Remove-CT $Pages_Library $_ } Or an even shorter version: $site | Get-SPWeb -Limit all | % { Remove-CT $_.Lists[$lookForList] $_ }


2

if you want to recursive for specific SPWeb than try this : SPWeb web = SPContext.Current.Web; recursive(web); function for recursive : protected void recursive(SPWeb web) { string webTitle = web.Title; if (web.Webs.Count > 0) { foreach (SPWeb oweb in web.Webs) { recursive(...


1

did you try this one: static string mainpath = "http://triad102:1001"; static void Main(string[] args) { getSubWebs(mainpath); Console.Read(); } public static void getSubWebs(string path) { try { ClientContext clientContext = new ClientContext( path ); Web oWebsite = ...


1

you can use WebsInfo property of SPWebCollection class var list = SPContext.Current.Site.AllWebs.WebsInfo; then you can perform action with SPWebInfo class.


1

Its all happening in SharePoint Manager, just download source code and look at code to get what you want. Hope it helps :).


1

Is your code dll signed? and can you also check if your AssemblyInfo.cs has [assembly: AllowPartiallyTrustedCallers()] If above doesn't help then try to change the trust level from “Minimal trust” to “Medium trust” or other higher level. More info: http://www.ben-morris.com/allow-partially-trusted-callers-asp-net-shared-hosting-environments


1

Another approach is to use the WebsInfo member of SPWebCollection (AllWebs). http://www.ilovesharepoint.com/2011/07/perfect-loop-looping-through-all-webs.html. If you need a limited set of properties, you don't have to worry about disposing it because it is not IDisposable and it is performant. But if you are using AllWebs, you need to dispose each web ...


Only top voted, non community-wiki answers of a minimum length are eligible