0

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:

webapplications
 site collections
  websites
   usergroups
    roles
    users

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?

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

1 Answer 1

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.

http://msdn.microsoft.com/en-us/library/office/ms462161(v=office.14).aspx

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)
                  {
                       Console.WriteLine(webapp.Name);
                      //Enumerate through each site collection
                      foreach (SPSite site in webapp.Sites)
                      { 
                          //Console.WriteLine(site.Url);

                          //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.

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