On my SPS portal, I create all of my WSS sites beneath the default
site creation url, "http:/<portal name>/sites/", and I would like to
enumerate all of those WSS sites in code.
I've attempted this syntax:
SPSite siteCollection = new SPSite(urlArg);
SPWebCollection sites = siteCollection.AllWebs;
foreach (SPWeb site in sites){
//do something.
}
If I input the complete WSS site url in the urlArg ("http://<portal
name>/sites/<wss name>"), this code works, but I want to enumerate
all of the sites created beneath "http:/<portal name>/sites/" instead.
If I input "http://<portal name>" or "http://<portal name>/sites" for
the urlArg, the code will enumerate the lists, areas, and sub-areas
at the portal level only, ignoring any WSS sites.