How to check all subsites data through command prompt

I am using MOSS 2007 ,we don't have powershell,  I have to check the size of all subsites size. I run the command in command prompt
C:\programfiles\commanfiles\microsoftshared\webserverextensions\12\BIN>stsadm -o enumsubwebs -url
http://abc.xyz.com
I got all subsites urls, but i need all url's size also. How to do through command prompt?

Hi Ravikiran,
The codeplex solution is a custom solution built using SharePoint Server object model, you can download the code also from the following location.
http://spusedspaceinfo.codeplex.com/releases/view/20413
The following is the code from the above project.
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.IO;
using Microsoft.SharePoint;
using System.Diagnostics;
using Microsoft.SharePoint.Administration;
using System.Collections.Generic;
namespace SPUsedSpaceInformation
class Program
static void Main(string[] args)
SPFarm farm = SPFarm.Local;
SPWebService service = farm.Services.GetValue<SPWebService>("");
Console.WriteLine("Select a Web Application:");
Console.WriteLine("-------------------------");
int n = 1;
List<Guid> webAppIds=new List<Guid>();
foreach (SPWebApplication webApplication in service.WebApplications)
Console.WriteLine(string.Format("{0}) {1}", n, webApplication.DisplayName));
webAppIds.Add(webApplication.Id);
n++;
int quit=n;
Console.WriteLine(string.Format("{0}) Quit",n));
Console.WriteLine("? ");
int choice1 = 0;
while (true)
string choice2 = Console.ReadLine();
if (int.TryParse(choice2, out choice1))
if (choice1 > 0 && choice1 < quit)
SPWebApplication webApplication = service.WebApplications[webAppIds[choice1 - 1]];
Console.WriteLine("Select a Site Collection:");
Console.WriteLine("-------------------------");
n = 1;
foreach (SPSite site in webApplication.Sites)
Console.WriteLine(string.Format("{0}) {1}", n, site.Url));
n++;
quit=n;
Console.WriteLine(string.Format("{0}) Quit",n));
Console.WriteLine("? ");
choice1 = 0;
while (true)
choice2 = Console.ReadLine();
if (int.TryParse(choice2, out choice1))
if (choice1 > 0 && choice1 < quit)
SPSite siteColl = webApplication.Sites[choice1 - 1];
DataTable tableStorage = siteColl.StorageManagementInformation(SPSite.StorageManagementInformationType.Document, SPSite.StorageManagementSortOrder.Decreasing, SPSite.StorageManagementSortedOn.Size, 0xf4240);
Hashtable ht = new Hashtable();
foreach (DataRow dr in tableStorage.Rows)
if (ht[dr["WebUrl"].ToString()] == null)
ht[dr["WebUrl"].ToString()] = (double)dr["TotalSize"];
else
ht[dr["WebUrl"].ToString()] = ((double)ht[dr["WebUrl"].ToString()]) + ((double)dr["TotalSize"]);
string folderPath = string.Concat(new object[] { Directory.GetCurrentDirectory(), Path.DirectorySeparatorChar, "Listings" });
if (!Directory.Exists(folderPath))
Directory.CreateDirectory(folderPath);
using (StreamWriter writer = File.CreateText(string.Concat(new object[] { folderPath, Path.DirectorySeparatorChar, "SitesListingsUsage", DateTime.Now.ToString().Replace("/", "-").Replace(":", "-"), ".csv" })))
foreach (string key in ht.Keys)
writer.WriteLine(string.Format("{0};{1}", key, ht[key].ToString()));
SPWeb currentWeb = siteColl.RootWeb;
using (currentWeb)
using (StreamWriter writer = File.CreateText(string.Concat(new object[] { folderPath, Path.DirectorySeparatorChar, "SitesListingsInfo", DateTime.Now.ToString().Replace("/", "-").Replace(":", "-"), ".csv" })))
string separation = string.Empty;
ListWebs(currentWeb, separation, writer);
Console.WriteLine("Press a touch to quit...");
Console.ReadLine();
Process.Start(folderPath);
return;
else if (choice1 == quit)
return;
else
Console.WriteLine("? ");
else
Console.WriteLine("? ");
else if (choice1 == quit)
return;
else
Console.WriteLine("? ");
else
Console.WriteLine("? ");
private static void ListWebs(SPWeb Web, string Separation, StreamWriter Writer)
string ownersMail = string.Empty;
SPGroup ownerGroup = null;
ownerGroup = Web.AssociatedOwnerGroup;
if (ownerGroup == null)
foreach (SPRoleAssignment roleAssignment in Web.RoleAssignments)
if ((roleAssignment.Member is SPGroup) && roleAssignment.Member.Name.ToLower().Contains("owner"))
SPGroup group = (SPGroup)roleAssignment.Member;
foreach (SPUser user in group.Users)
if (!string.IsNullOrEmpty(user.Email))
if (string.IsNullOrEmpty(ownersMail))
ownersMail = user.Email;
else
ownersMail = ownersMail + "," + user.Email;
break;
else
foreach (SPUser user in ownerGroup.Users)
if (!string.IsNullOrEmpty(user.Email))
if (string.IsNullOrEmpty(ownersMail))
ownersMail = user.Email;
else
ownersMail = ownersMail + "," + user.Email;
string accessRequestMail = string.Empty;
if (Web.RequestAccessEnabled)
accessRequestMail = Web.RequestAccessEmail;
string authorMail = string.Empty;
try
authorMail = Web.Author.Email;
catch { }
Writer.WriteLine(string.Format("{0};{1};{2};{3};{4};{5};{6}", new object[] { Web.Title, Web.Url, authorMail, Web.Created.ToString(), accessRequestMail, Web.LastItemModifiedDate.ToString(), ownersMail }));
Console.WriteLine(string.Format("{0};{1};{2};{3};{4};{5};{6}", new object[] { Web.Title, Web.Url, authorMail, Web.Created.ToString(), accessRequestMail, Web.LastItemModifiedDate.ToString(), ownersMail }));
foreach (SPWeb childWeb in Web.Webs)
ListWebs(childWeb, Separation + "--", Writer);
Please don't forget to mark it as answered, if your problem resolved or helpful.

Similar Messages

  • How to create create oracleserviceSID manually through command prompt

    Hello Experts ,
    We want to create oracleserviceSID manually through command prompt in our BIW 3.5 server based on oracle 9.2 . wts the procedure of create this oracle service manually . Requested to revert at earliest as this is very urgent .
    points guaranteed .
    Regards,
    Somya

    hi
    i guess that your q's is how to create oracle service source id if the system is already connected to your BW server?
    to assign the source id to the source system goto tools in your DWB->assignment of source id to source system->assign the SID there
    to create a new one press F5 from the same screen & give the logical system name.
    check
    SAP Note 518241 for establishing the connection

  • How to check all songs in iTunes

    Until now when I double click a song in iTunes, it plays the song and continues to play all the songs that follow. Now I play one song and it stops and does not play the following songs.  How to check all songs in iTunes? so the music will continue

    52,
    Try command clicking a song and it should select all in songs or a playlist.

  • How to see all  psa  data   in bi-7

    how to see all  psa  data   in bi-7  all info area

    Hi,
    In BI 7.0 you wont find PSA tab in RSA1 (data warehousing workbench), for that you need to use RSA1OLD tcode.
    Other way is to go to the datasource and then right click->manage there you can find option to check all PSA requests which were staged from that datasource.
    Hope it helps....
    Cheers,
    Habeeb

  • How do I access session data through an EJB?

    Hi
    How do I access session data through an EJB?
    I am currantly developing a Web service (using ejb's, JBoss.net and Apache Axis). A client making a call to this Web service, is expecting a bussiness-object in return. My problem is that this bussiness-object i stored in a users session data. How do I retrieve this bussiness-object from the users session.
    I have read that this does not work with httpsessions, is this true? If this is true, is it possible to store the bussiness object in a JavaBean e.g:
    <jsp:useBean id="userContextWebImpl" scope="session" class="com.ac.march.client.UserContextWebImpl">
    <%
    String key = "test";
    String value = "This is the value";
    userContextWebImpl.setValue( key, value1 );
    %>
    </jsp:useBean>
    and then retrieve this information through the EJB? Or is it possible to do this by using Statfull JavaBeans? Or can this be done through a nother solution?
    Please help!

    I have created a JavaBean with scope="application" to store some data. The data is stored when a user prefomes a spesific task.
    A different person then makes a call to a Web-Service on the server. The Web-Service then asks an EJB to retrieve the data stored in the JavaBean (servlet cotext). In other words: How do I retrieve this data from the EJB?
    I have tried with this code, but with no luck.
    (ApplicationContextWebImpl is the JavaBean)
    public static String getBookingResult( String key )
         String myResult = null;
         String myKey = key;
         ApplicationContextWebImpl applicationContextWebImpl = null;
         try
              applicationContextWebImpl = new ApplicationContextWebImpl();
              myResult = (String)applicationContextWebImpl.getValue( key );
         catch ( java.rmi.RemoteException e )
         return myResult;
    }

  • How to monitor all SAP Server through solution Manager?

    Dear Friends,
    How to monitor all SAP Server through solution Manager?
    Is it possible if yes then how? Please forward configuration and transaction also.
    Please help me as early as possible..
    Thanks,
    Regards,
    Sachin

    Hi sachin,
    You can monitor your sattilite systems through solution manager.
    If you want to monitor systems in solution manager means you need to configure those systems in solution manager.
    Before including the systems in solution manager we need to create a solution using tcode <b>DSWP</b>.
    After that you can include the systems using tcode <b>SMSY</b>.
    For configuring the systems we have lot of phases its very difficult to explain here.
    Try to login to<b> service.sap.com</b> and <b>help.sap.com</b> find the helpfull guides.
    i hope it will help you.
    any issues post it.
    kiran kumar.v

  • How to transfert all my data and config from 4 to 4s

    Hello,
    Is there a "step by step" doc. On how to transfert all my data and config
    From one iphone 4 to a 4s without using outlook ( ex:for contacts ) etc...
    I don't get the ITunes method, sync direction etc...
    All my Iphone 4 Put into my knew Iphone 4 S within a click !
    Maybe there's an app for that :-).
    Thanks for the Help.

    iOS: Transferring information from your current iPhone, iPad, or iPod touch to a new device

  • How to install adobe flash player through command line with some script

    Hi Guys,
    Do you know how to install adobe flash player through command line with some script?
    Thanks,
    Galina

    Windows. I tried silent install  with "install_flash_player.exe /install" but it works only with one file that I downloaded from adobe.com - "install_flashplayer10_mssd_aih.exe". But it is possible to download this last file only one time, every next time it redirects me to download install_flash_player.exe file.

  • I am switchning from iphone 3gs to iphone 4. can some one guide me how to transfer all my data to iphone 4?

    i am switching from iphone 3gs to iphone 4. can some one guide me how to transfer all my data to iphone 4?
    i have a back up in my itunes account .can anyone suggest please ????

    http://support.apple.com/kb/ht2109

  • How to check if Oracle Data Access Components  is installed?

    How to check if  Oracle Data Access Components is installed and version on my computer?
    Also How to check if Oracle Data Provider is installed and version?
    TIA
    Steve42

    Regedit HKLM->Software->Oracle.  See what's there...
    At the very least, that can give you paths and can check file versions from there.

  • How to connect PC to data through iPhone (unlimited metropcs)

    How to connect PC to data through iPhone (unlimited metropcs). Now I tried PC write: limited connect

    The following gives details about how to set up personal hotspot so your computer can share your phone's data connection. Note that in order for this to work you must have a cellular data plan that supports this feature. You may need to contact your cellular provider. http://support.apple.com/kb/HT4517

  • How to undeploy an .sda file through command line

    Hi,
    How to undeploy an .sda file through command line.send me the related command to do it.and related information and links.

    Hi
    Please find below the steps to undeploy thro command line :
    Shut down the sdm server
    1)SDM shutdown "sdmhome=D:\usr\sap\J2E\JCO1\SDM\program" "sdmguiport=50018" "sdmhostname=<hostname>" password="<password>" "shutdownmode=abort"
    2)sdm jstartup "mode=standalone" "sdmhome=c:\usr\sap\J2E\DVEBMGS00\SDM\program"
    3) sdm undeploy "sdmhome=D:\usr\sap\J2E\DVEBMGS00\SDM\program" "compname=c:\test.sda"
    4)sdm jstartup "mode=integrated" "sdmhome=c:\usr\sap\J2E\DVEBMGS00\SDM\program"
    5)start the sdm server again
    SDM server "sdmhome=D:\usr\sap\J2E\JCO1\SDM\program"
    Hope this helps. do not forget to reward points
    regards
    rajeshkr

  • Lost all contacts and data after update iOS 7.1.2, how to recover all the data?

    lost all contacts and data after update iOS 7.1.2, how to recover all the data?
    it's very important to me...

    Restore from your last backup file.

  • How to check system status from Windows command line?

    Does anyone has an idea how to check system status from Windows command line? In UNIX we use startsap check, unfortunately I didn't find an appropriate command provided by SAP.
    The only idea we have is to use
    tasklist /FI "Username eq SAPService<SID>" | find "disp+work"
    which isn't as nice as startsap check.

    Hi,
    In windows you can use the command
    go to profile directory in command prompt and the give the following command to check the status of the instance.
    sapstart check pf=START_DVEBMGS<nr>_<hostname>
    that means you need to mention start profile or instance profile. So that it will say whether the instance is running or not.
    If you want any other information please reply back to me.
    Thanks,
    Chaitanya.

  • How to call the javascript through Command prompt?

    I need to call the .js file through command prompt. And also through programming language like c++, java. Could you please advice me with samples.This is for "illustrator cs".

    You can also look into use of COM scripting interface to the Adobe programs. Unfortunately, this means you have to do some programming/scripting to create a (command line) script that you can execute like
    cscript C:\somePath\myScriptLauncher.vbs  C:\somePath\anAdobeScript.jsx
    or
    cscript C:\somePath\myScriptLauncher.js  C:\somePath\anAdobeScript.jsx
    the scripts can be written in VBScript (*.vbs) or Microsoft JScript (*.js) which can access COM objects thus the Adobe program's COM APIs.
    Nothing purely simple as a command line option in this solution. But it does offer customization as an advantage.
    This might be a slightly useful reference.
    http://stackoverflow.com/questions/3846626/is-it-possible-to-execute-jsx-scripts-from-outs ide-extendscript
    there's one post mentioning COM in there.
    And of course, you can also use COM through C++, Java, C#, Visual Basic, etc. as well, not restricted to VBScript and JScript, though I've found it's easier to use the latter two for COM.

Maybe you are looking for

  • RD Connection Broker, do I need any third party items to do load balancing?

    RD Connection Broker does load balancing and session reconnect.  Are there limitations to its load balancing features? (i.e. reasons to go with a third party solution)  Also is it a stand a lone service do we need specific network/services to make it

  • Ipod touch freezes when plugging into ford escape via aux input (not sync)

    My daughter tried to plug her ipod touch into her escape using line-in and it freezes.  My son's does not.  His is newer than hers.  Can I assume a software update will correct her problem?  She says she has never updated the ipod software...don't kn

  • Change keyboard language by java program

    I have done internationalization successfully in my java web application. but for insert input i always need to select language of keyboard manualy by control panel's . have any one java program to select keyboard language programatically.

  • ASo to BSO formula

    Hi All IS it right calc script for bso is it right conversion ASo to BSO but its giving problem ASO=SUM({[2009.Q1].Children,[2009.Q2].Children}) BSO@SUM(@children("2009.Q1" and "2009.Q2"));

  • Commonj TimerManager Help

    I'm looking into using the commonj TimerManager as a scheduler in my application. I am following examples and articles found on the following page http://dev2dev.bea.com/wlplatform/commonj/twm.html I'm having problems with configuration. I'm running