I am using sharepoint 2007 and is installed on windows server 2003 R2. I would like to create some script to show a environment summary like:

 site collections

I can access stsadm. I hope I can write the summary to some file. Otherwise print it on the screen. How can I implement this?

ps. isn't it possible to use/install powershell on windows server 2003 r2?

  • yes powershell can be installed...then perform two steps : 1) Set the Execution Policy to 'RemoteSigned' 2) load the SharePoint assemblies Aug 11, 2014 at 9:38

1 Answer 1


SharePoint 2007 does not have PowerShell support.

In Visual Studio create a console application that loops through all the site collections and sites. You need to run this program on the SharePoint 2007 server.


static void Main(string[] args)
                  SPFarm farm = SPFarm.Local;
                 //Get all SharePoint Web services
                  SPWebService service = farm.Services.GetValue<SPWebService>("");

                  foreach (SPWebApplication webapp in service.WebApplications)
                      //Enumerate through each site collection
                      foreach (SPSite site in webapp.Sites)

                          //Enumerate through each sub-site
                          foreach (SPWeb web in site.AllWebs)

For every site print the users and security settings. You will find plenty of samples online.

Note: This can be a lengthy and resource intensive operation. Make sure you Dispose() all your objects properly.

  • I knwo it is possible to do this stuff programmatically. But I would like to avoid development. Is there some solution in stsadm?
    – Ola
    Aug 12, 2014 at 9:05
  • Maybe Garry lapointe stsadm extensionhttp://blog.falchionconsulting.com/index.php/downloads/
    – Wout
    Aug 12, 2014 at 9:26
  • Or the tool 'Sushi' has a "security audit" reporting function sushi.codeplex.com/releases/view/22248.
    – Wout
    Aug 12, 2014 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.