which country user step here?

Tag Cloud

MOSS (47) SharePoint 2007 (37) SharePoint 2013 (31) SharePoint 2010 (23) MOSS admin (17) PowerShell (17) admin (17) developer (16) List (15) WSS (14) sql query (14) MOSS SP2 (13) end user (11) scripting (11) wss V3 (11) permission (10) sql (9) Moss issue (8) search (8) database (7) RBS (6) Service Pack (6) reportadmin (6) workflow (6) CU (5) Excel (5) Patch (5) client object model (5) Client Code (4) Command (4) Cumulative Updates (4) IIS (4) SharePoint 2019 (4) SharePoint designer (4) office 365 (4) stsadm (4) user porfile (4) ASP.NET (3) Content Database (3) Groove (3) Host Named Site Collections (HNSC) (3) SharePoint 2016 (3) Tutorial (3) alert (3) authentication (3) batch file (3) codeplex (3) domain (3) error (3) incomming email (3) issue (3) restore (3) upload (3) Caching (2) DocAve 6 (2) Folder (2) Index (2) Internet (2) My Site Cleanup Job (2) My Sites (2) News (2) People Picker (2) Share Document (2) SharePoint admin (2) View (2) Web Development with ASP.NET (2) add user (2) audit (2) coding (2) column (2) deploy solution (2) download (2) enumsites (2) exam (2) export (2) june CU (2) load balance (2) mySites (2) network (2) orphan site (2) performance (2) profile (2) project server (2) query (2) security (2) server admin (2) theme (2) timer job (2) training (2) web master (2) web.config (2) wsp (2) 70-346 (1) 70-630 (1) AAM (1) Anonymous (1) Approval (1) AvePoint (1) Cerificate (1) Consultants (1) Content Deployment (1) Content Type (1) DOS (1) Document Library (1) Drive Sapce (1) Excel Services (1) Export to Excel (1) Feature (1) GAC (1) Get-SPContentDatabase (1) Get-WmiObject (1) HTML calculated column (1) ISA2006 (1) IT Knowledge (1) ITIL (1) Install (1) Link (1) MCTS (1) Macro (1) Masking (1) Migration (1) NLBS (1) Nintex (1) Office (1) Open with Explorer (1) ROIScan.vbs (1) Reporting Services (1) SPDisposeCheck.exe (1) SQL Instance name (1) SSRS (1) Sandbox (1) SharePoint Online (1) SharePoint farm (1) Shared Services Administration (1) Site Collection Owner (1) Site template (1) Skype for business (1) Steelhead (1) Teams (1) URLSCAN (1) VLOOKUP (1) WSS SP2 (1) XCOPY (1) abnormal incident (1) admi (1) app (1) application pool (1) aspx (1) availabilty (1) backup (1) binding (1) blob (1) branding sharepoint (1) cache (1) calendar (1) change password (1) connection (1) copy file (1) counter (1) crawl (1) custom list (1) domain security group (1) event (1) excel 2013 (1) facebook (1) filter (1) fun (1) group (1) iis log (1) import (1) import list (1) improment (1) interview (1) keberos (1) licensing (1) log in (1) metada (1) migrate (1) mossrap (1) notepad++ (1) onedrive for business (1) operation (1) owa (1) process (1) publishing feature (1) resource (1) send email (1) size (1) sps2003 (1) sql201 (1) sql2012 (1) sub sites (1) system (1) table (1) task list (1) today date (1) trial (1) vbs (1) video (1) web part (1) web server (1) widget (1) windows 2008 (1) windows 2012 R2 (1) windows Azura (1) windows account (1) windows2012 (1) wmi (1)
Showing posts with label admin. Show all posts
Showing posts with label admin. Show all posts

Thursday, September 24, 2015

Better explanation than Technet about Export-SPWeb

technet site for Export-SPWeb :  https://technet.microsoft.com/en-us/library/ee428301.aspx

this site look like not so helpful for me to export the list ...

i prefer this more detail site explanation :

http://blog.blksthl.com/2013/09/05/export-a-document-library-using-export-spweb-and-itemurl/

===========================================================================================

Export-SPWeb
(This is my better version of the TechNet articles on the same CMDlet that does a poor job with the details, I hope that it will help some of you)
SharePoint 2010 | SharePoint 2013
‘
Applies to:  SharePoint Foundation 2010 | SharePoint Server 2010 | SharePoint Foundation 2013 | SharePoint Server 2013 
‘
Exports a site, list, or library.
‘
Export-SPWeb [-Identity]  -Path  [-AssignmentCollection ] [-CompressionSize ] [-Confirm []] [-Force ] [-HaltOnError ] [-HaltOnWarning ] [-IncludeUserSecurity ] [-IncludeVersions ] [-ItemUrl ] [-NoFileCompression ] [-NoLogFile ] [-UseSqlSnapshot ] [-WhatIf []]
‘
——————–EXAMPLE———————–
Export-SPWeb http://site –Path "c:\temp\site export.cmp" -ItemURL "/subsite/documents"
This example exports the document library at http://site/subsite/documents to a new file called ‘site export.cmp' in the ‘C:\temp’ directory.

Tuesday, April 5, 2011

How Many current connection to your IIS ?

Recently server is out of memory , so thinking to check and see how many connection is connected to my sharepoint web application.

 

At last have found one counter is under Web services > current Connection.

 

This counter is show how many current connection is connected to your web application.

 

Run Perfmon then add the counter , you will see it.

Thursday, February 24, 2011

sub sites owner with Full Control unable to add Content Editor Web Part

after so many year at sharepoint , just notice web part also have permission setting.

 

below is the detail from the forum.

 

 

http://www.tek-tips.com/viewthread.cfm?qid=1444650&page=3

 

Background: SharePoint V3 on a hosted server. The user is a "site owner" and "site owners" have "full control" over the site.  "full control" has all the options that can be selected for security.  This is a sub-site to the main SharePoint site and it does not inhearit security from the parent site.  I want site owners to have full control over there individual sites, but not have control over other's sites.  
Problem: When the user goes to add a web part to the "Home" page of the site via selecting "Site Actions" - "Edit Page" the only web parts that are available to them are the "Lists and Libraries" web parts that consist of "Announcements", "Calendar", "Links", "Shared Documents", "Tasks", and "Team Discussion".
When a Site Collection Administrator does the same thing as above, they see all the web parts listed above as well as "Miscellaneous" web parts consisting of "Content Editor Web Part", "Form Web Part", "Image Web Part", "Page Viewer Web Part", "Relevant Documents", "Site Users", "User Tasks", and "XML Web Part".  Is it possible to make these web parts accessible to the owners of sub-sites with out giving them full control over the entire SharePoint site hierarchy?

 

 

I believe I figured out a solution.  So, if your curious, here is how I fixed it.
Logged into the top level SharePoint site as a site collection administrator.
Select "Site Actions" - "Site Settings"
In the "Galleries" Colum, select "Web Parts"
With the Web Part Gallery open, select the "Settings" menu and select "Gallery Settings"
Now you should be in the Customize Web Part Gallery window.  In the "Permissions and Management" column, select "Permissions for this gallery".
In the "Permissions: Web Part Gallery" Select "Actions" - "Edit Permissions"
Select "OK" to the pop up that is displayed warning you that you are about to create unique permissions, and now you can select "New" and add additional users to the Gallery.
This will allow whomever you add to see all the Web Parts available.

Tuesday, January 18, 2011

A way to determine the size of subsites?

There's a tool on Codeplex that will give you this information: http://www.codeplex.com/SPUsedSpaceInfo .


Bob Klass also has a tip in his blog of another way to try to get that info:http://bobklass.blogspot.com/2009/01/easy-way-how-to-find-sharepoint-subsite.html .

Easy Way How to Find SharePoint Subsite Size

I was looking for a GOOD way to find out the size of subsites. It seems a lot of people are struggling with this. You could try SharePoint Designer. That's fun. When you ask it site properties, it will give you a different answer depending on what document libraries or lists you touched. Obviously that is not going to be reliable.

I'll cut to the chase (although I was trying to be as wordy as possible). This isn't a GOOD way, but it is a very simple way:

  • open the site in Windows Explorer
  • navigate to the root of the site or subsite in question
  • right click, properties

That may be a little resource intensive - it takes a while to open. I think it may have to open a lot more than it appears just to get you that number, but there it is in the properties window. Piece of cake.

 

Post Script: http://www.codeplex.com/SPUsedSpaceInfo is a console app to get a CSV listing of sites and their size. Beware that the setup is pretty heavy handed - a Dotnet 3.5 SP1 installation starts right up if you aren't there already.

 

 

If you only have a couple of sites you want to take a look at and don't want to install a tool, you might try it. I would caution you to take his approach with a grain of salt, I am a lot more confident in the accuracy of a solution that uses the SharePoint object model to retrieve this information than his "hack" through the Windows Explorer GUI. I just would expect the object model to be able to present a much more true picture of how much storage a site is using than the UI would.

Tuesday, January 11, 2011

Some queries with Share[point content DB

Some queries with these tables:

-- Query to get all the top level site collections

SELECT SiteId AS Siteid, Id AS Webid, FullUrl AS FURL, Title, Author, TimeCreated FROM dbo.Webs WHERE (ParentWebId IS NULL)

 

-- Query to get all the child sites in a site collection

SELECT SiteId AS Siteid, Id AS Webid, FullUrl AS FURl, Title, Author, TimeCreated FROM dbo.Webs WHERE (NOT (ParentWebId IS NULL))

 

-- Query to get all the SharePoint groups in a site collection

SELECT dbo.Webs.SiteId, dbo.Webs.Id, dbo.Webs.FullUrl, dbo.Webs.Title, dbo.Groups.ID AS Expr1, dbo.Groups.Title AS Expr2, dbo.Groups.Description FROM dbo.Groups INNER JOIN dbo.Webs ON dbo.Groups.SiteId = dbo.Webs.SiteId

 

-- Query to get all the users in a site collection

SELECT dbo.Webs.SiteId, dbo.Webs.Id, dbo.Webs.FullUrl, dbo.Webs.Title, dbo.UserInfo.tp_ID, dbo.UserInfo.tp_DomainGroup, dbo.UserInfo.tp_SiteAdmin, dbo.UserInfo.tp_Title, dbo.UserInfo.tp_Email FROM dbo.UserInfo INNER JOIN dbo.Webs ON dbo.UserInfo.tp_SiteID = dbo.Webs.SiteId

 

-- Query to get all the members of the SharePoint Groups

SELECT dbo.Groups.ID, dbo.Groups.Title, dbo.UserInfo.tp_Title, dbo.UserInfo.tp_Login FROM dbo.GroupMembership INNER JOIN dbo.Groups ON dbo.GroupMembership.SiteId = dbo.Groups.SiteId INNER JOINdbo.UserInfo ON dbo.GroupMembership.MemberId = dbo.UserInfo.tp_ID

 

-- Query to get all the sites where a specific feature is activated

SELECT dbo.Webs.Id AS WebGuid, dbo.Webs.Title AS WebTitle, dbo.Webs.FullUrl AS WebUrl, dbo.Features.FeatureId, dbo.Features.TimeActivatedFROM dbo.Features INNER JOIN dbo.Webs ON dbo.Features.SiteId = dbo.Webs.SiteId AND dbo.Features.WebId = dbo.Webs.Id WHERE (dbo.Features.FeatureId = '00AFDA71-D2CE-42fg-9C63-A44004CE0104')

 

-- Query to get all the users assigned to roles

SELECT dbo.Webs.Id, dbo.Webs.Title, dbo.Webs.FullUrl, dbo.Roles.RoleId, dbo.Roles.Title AS RoleTitle, dbo.UserInfo.tp_Title, dbo.UserInfo.tp_Login FROM dbo.RoleAssignment INNER JOIN dbo.Roles ON dbo.RoleAssignment.SiteId = dbo.Roles.SiteId AND dbo.RoleAssignment.RoleId = dbo.Roles.RoleId INNER JOIN dbo.Webs ON dbo.Roles.SiteId = dbo.Webs.SiteId AND dbo.Roles.WebId = dbo.Webs.Id INNER JOIN dbo.UserInfo ON dbo.RoleAssignment.PrincipalId = dbo.UserInfo.tp_ID

 

-- Query to get all the SharePoint groups assigned to roles

SELECT dbo.Webs.Id, dbo.Webs.Title, dbo.Webs.FullUrl, dbo.Roles.RoleId, dbo.Roles.Title AS RoleTitle, dbo.Groups.Title AS GroupName FROM dbo.RoleAssignment INNER JOINdbo.Roles ON dbo.RoleAssignment.SiteId = dbo.Roles.SiteId AND dbo.RoleAssignment.RoleId = dbo.Roles.RoleId INNER JOIN dbo.Webs ON dbo.Roles.SiteId = dbo.Webs.SiteId AND dbo.Roles.WebId = dbo.Webs.Id INNER JOIN dbo.Groups ON dbo.RoleAssignment.SiteId = dbo.Groups.SiteId AND dbo.RoleAssignment.PrincipalId = dbo.Groups.ID

 

You can also find interesting to read Different Database created with SharePoint

 

Copy From http://manish-sharepoint.blogspot.com/2008/06/some-important-tables-with-sharepoint.html

Tuesday, December 14, 2010

user's list of web sites in SharePoint : SharePoint

SELECT DISTINCT w.Title, r.WebId, r.Title AS accessLevel, ui.tp_Login,
ui.tp_DomainGroup, ui.tp_Title, w.FullUrl, w.AlternateCSSUrl,
p.ScopeUrl
FROM RoleAssignment AS ra INNER JOIN
Roles AS r ON r.SiteId = ra.SiteId AND r.RoleId
= ra.RoleId INNER JOIN
UserInfo AS ui ON ui.tp_SiteID = ra.SiteId AND
ui.tp_ID = ra.PrincipalId INNER JOIN
Sites AS s ON s.Id = ra.SiteId INNER JOIN
Perms AS p ON p.SiteId = ra.SiteId AND p.ScopeId
= ra.ScopeId INNER JOIN
Webs AS w ON w.Id = p.WebId

 

copy from Forum

Wednesday, December 8, 2010

Clean Up Event ID 7888 and 5553.

see the error at your event viewer ?

 

 

failure trying to synch site 51d6d8b3-9ee0-4af3-af2f-fa5f78cc9651 for ContentDB 840eac13-c23e-4123-9fa2-9d2975d0ff13 WebApp 53ea7eb2-ec0f-4250-9d87-1550224223b8.  Exception message was Cannot insert duplicate key row in object 'dbo.UserMemberships' with unique index 'CX_UserMemberships_RecordId_MemberGroupId_SID'.
The statement has been terminated..

 

 

Solution here:

http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/11af8a85-0fca-466d-beac-d29d03297edf

 

solution summary :

 

  • Run 'stsadm- o preparetomove -Site <http://whatevertheguiltysiteis/> -OldContentDb <GUID of the contentdb listed in event log error>'
  • Run 'stsadm -o sync -deleteolddatabases 0'

FQA:

  • How do i know which site is it by GUID ?
    • -- QUERY#1 Run this against your config database, this will give you the content database name

      SELECT *
      FROM [SharePoint_Config].[dbo].[Objects]
      WHERE ID='<Content DB Id from error msg>'

      --QUERY#2
      -- Run followign queries against the database name returned by the QUERY#1

      SELECT [FullUrl]
      ,[Id]
      ,[RootWebId]
      FROM [WSS_Content_##_03].[dbo].[Sites]
      WHERE ID='<Site ID from event log message>'








      or you can run the query at sitemap table at the config database , then you will see all the site under this content db , then manually go to find out on the Path column of the site URL.



      SELECT [Id]

            ,[ApplicationId]


            ,[DatabaseId]


            ,[Path]


            ,[Pairing]


            ,[Status]


            ,[Version]


            ,[RedirectUrl]


            ,[HostHeaderIsSiteName]


        FROM [MOSS_CONFIG_DB].[dbo].[SiteMap]


      where [DatabaseId]='<Content DB Id from error msg>'

      Wednesday, December 1, 2010

      Delete old folder script

      nice script from internet again :D http://www.eggheadcafe.com/software/aspnet/31061977/an-easy-script-to-delete-folders-on-a-network-share-that-are-older-than-14-days.aspx

      change at cint( XX ) > XX for how many days old
      Directory > location of the folder you want delete. Network drive also can :)


      Dim Directory
      Dim Noofdays
      Dim FSO
      Dim FSO2
      Dim LogFile
      Dim Folderlist
      Dim folders
      Directory ="C:\Program Files\Microsoft Office Servers\12.0\Logs\UAP\"
      Noofdays=cint(30)
      LogFile="C:\Program Files\Microsoft Office Servers\12.0\Logs\UAP\deleted.txt"
      Set FSO = CreateObject("Scripting.FileSystemObject")
      Set FSO2 = CreateObject("Scripting.FileSystemObject")
      Set oFSO = CreateObject("Scripting.FilesyStemObject")
      '
      If oFSO.FileExists(Logfile) Then
      Const ForAppending = 8
      Set ofile = oFSO.OpenTextFile(LogFile, ForAppending, True)
      Else
      Set oFile = oFSO.CreateTextFile(logfile, true)
      End If
      ofile.writeline "Delete Folders older than 30 days Started   --> " & now()
      Set Folderlist = FSO.GetFolder(Directory)
      Set folders = Folderlist.SubFolders
      For Each d In Folders
      '          msgbox d.name
      '          msgbox d.size
      '          msgbox d.dateCreated
      '          msgbox d.dateLastModified
      '          msgbox d.dateLastAccessed
      tempdirectory = Directory & d.name
      If  datediff("d",d.dateCreated,now()) > Noofdays Then
      FSO2.DeleteFolder(tempdirectory )
      ofile.writeline "Deleting Folder...." & tempdirectory
      if err.number <>0 then
      ofile.writeline cstr(now()) & "    " & Err.description
      err.clear
      end if
      End If
      Next
      ofile.writeline "Delete Folders older than 30 days Completed --> " &now()
      ofile.writeline "--------------------------------------------"
      ofile.close

      Monday, November 8, 2010

      Site Collection Administrator VS Site Owner

      hi hi..one of the question ask by interviewer :D . as i understand is about the recycle bin and quota reach limit contact!!  After that i found the answer here :

       

      http://blogs.sharepointhosting.com/Lists/Posts/Post.aspx?ID=61

       

      About twice a week someone calls or writes into support trying to figure out why their Site Owners cannot reset passwords, manage the recycle bin, or "see everything" in site settings. The answer is pretty easy – you have to be a Site Collection Administrator to be able to perform those actions. The next question we get from Site Owners is "how do I become a Site Collection Administrator?" The answer is easy enough, find out who your current Site Collection Administrator is and ask that individual to promote you to that role. Here's a short tutorial on how to create new Site Collection Administrator.

      Take a look at the graphic below (click for full version). It displays the different views if you will see if you log into the Site Settings portion of your WSS 3.0 site as a member of the site owner's group and then as a Site Collection Administrator. Hint – the Site Collection Administrator's view is the top image. You can easily replicate this for yourself if you want to test it out – just create a test user that is a member of the Site Owners (or similar) SharePoint security group and go to the site settings page.

       

      Extra this are at site setting :D [all the time our permission is Farm admin , then will never notice about this!! ha ha] Now you know? :D

      image

      Tuesday, October 26, 2010

      change sub-site to a new sub-site URL and wanted the old link auto redirect to the new link.

      1. Go to old URL link and open in SPD
      2. Create an .aspx page
      3. Paste the coding in .aspx page(target site URL)
        •  <meta http-equiv="refresh" content="0;url=http://xxxxx/sites/xxxxxxxxxx/yyyyyy">
      4. Right click .aspx page > click Set as Home Page
      5. Rename the .aspx page to default.apsx

      Monday, October 25, 2010

      Who Deleted my SharePoint Top Level Sites!!!!

      have customer want to know who deleted his top level sites ( aka site collection ).

       

      the easy answer is the one site collection admin or the user have full control permission at your site collection!!

       

      But let say have 100 site collection admin!!! ha ha..so which one is the one??

       

      oh yeah easy to trace is go to the IIS log file then search it at the folder level:

       

      A word or phrase in the file with

      “/sites/<sites collection name>/_layouts/deleteweb.aspx ”.

       

      yeah!!! shoot the one delete it!!! ha ha

      Tuesday, August 10, 2010

      The faster way get the enumsites report in excel

      Just notice have the easy way for you to get the nice report with the stsadm enumsites command. you can see the top level sites , owner, content db report between one minute!!! cool !!

      stsadm -o enumsites -url http://abc.com > sitelist.xml
      Then just opened up the xml file with excel2007. (really beginning to like the features in this version)

      It warned that there was not an associated schema, would I like to create on from the file, ‘yes Please’!

      And now we can sort, filter, sum, etc.

      Wednesday, August 4, 2010

      Great SharePoint Tutorials site to share

      here have some freebies to share from internet, if you like to have some training tutorials for your SharePoint user here is have good one.

       

      Video Tutorials > easy to learn :D enjoy ya

       

      http://www.fpweb.net/sharepoint-tutorials/

    • Templates & Navigation
    • Create a SharePoint Group
    • Delete a Group
    • Create a Site Template
    • Create a List Template
    • Change Title Description & Logo
    • Change Quicklist Order
    • Add Quicklist Link
    • Top Link Bar - Change Order
    • Top Link Bar - Delete Item
    • Top Link Bar - Add Item
    • Enable Tree View
    • Explorer View
    • Log out
    • Site & User Administration
    • Add a new User
    • Reset User Password
    • Create a Site Collection
    • Delete a Site Collection
    • SharePoint Designer - Backup Site
    • Check Site Usage
    • Regional Settings
    • Set up Anonymous Access
    • Permissions & Alerts
    • Set Document Permissions
    • Library Permissions
    • List Permissions
    • Create Email Alerts
    • Delete an Email Alert
    • Documents & Tasks
    • Assign Tasks
    • Deassign Tasks
    • Restore Deleted Item
    • Web Parts
    • Add Web Parts
    • Create a Web Part Page
    • Content Editor Web Part

      • SQL query to find "DayLastAccessed" in portal's Site DB

        is time to do clean up for the SharePoint environment , have 2 option i know we can do that. one is manual one is auto :P ha ha ha

         

        Auto one you can setup at CA, Site use confirmation and deletion  /_admin/applications.aspx . not sure how correct is it!! ha ha

         

        but i prefer manual one.so use below query to check day last accessed , so we can guess is still used or not.

         

        SELECT     FullUrl AS 'Site URL', TimeCreated, DATEADD(d,
        DayLastAccessed + 65536, CONVERT(datetime, '1/1/1899', 101)) AS
        lastAccessDate
        FROM Webs
        WHERE (DayLastAccessed <> 0) AND (FullUrl LIKE N'sites/%')
        ORDER BY lastAccessDate

        Useful SQL Queries to Analyze and Monitor SharePoint Portal Solutions Usage

         

        keep track on what i can get from internet about SQL query for SharePoint :

         

        i am looking for last access to sites query, but unable to find..but found some other interesting one.. at below from this link

         

         

        A List of SQL Queries

        • Top 100 documents in terms of size (latest version(s) only):

          Collapse

          SELECT TOP 100 Webs.FullUrl As SiteUrl, 
          Webs.Title 'Document/List Library Title',
          DirName + '/' + LeafName AS 'Document Name',
          CAST((CAST(CAST(Size as decimal(10,2))/1024 As
          decimal(10,2))/1024) AS Decimal(10,2)) AS 'Size in MB'
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1 AND (LeafName NOT LIKE '%.stp')
          AND (LeafName NOT LIKE '%.aspx')
          AND (LeafName NOT LIKE '%.xfp')
          AND (LeafName NOT LIKE '%.dwp')
          AND (LeafName NOT LIKE '%template%')
          AND (LeafName NOT LIKE '%.inf')
          AND (LeafName NOT LIKE '%.css')
          ORDER BY 'Size in MB' DESC



        • Top 100 most versioned documents:

          Collapse



          SELECT TOP 100
          Webs.FullUrl As SiteUrl,
          Webs.Title 'Document/List Library Title',
          DirName + '/' + LeafName AS 'Document Name',
          COUNT(Docversions.version)AS 'Total Version',
          SUM(CAST((CAST(CAST(Docversions.Size as decimal(10,2))/1024 As
          decimal(10,2))/1024) AS Decimal(10,2)) ) AS 'Total Document Size (MB)',
          CAST((CAST(CAST(AVG(Docversions.Size) as decimal(10,2))/1024 As
          decimal(10,2))/1024) AS Decimal(10,2)) AS 'Avg Document Size (MB)'
          FROM Docs INNER JOIN DocVersions ON Docs.Id = DocVersions.Id
          INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1
          AND (LeafName NOT LIKE '%.stp')
          AND (LeafName NOT LIKE '%.aspx')
          AND (LeafName NOT LIKE '%.xfp')
          AND (LeafName NOT LIKE '%.dwp')
          AND (LeafName NOT LIKE '%template%')
          AND (LeafName NOT LIKE '%.inf')
          AND (LeafName NOT LIKE '%.css')
          GROUP BY Webs.FullUrl, Webs.Title, DirName + '/' + LeafName
          ORDER BY 'Total Version' desc, 'Total Document Size (MB)' desc



        • List of unhosted pages in the SharePoint solution:

          Collapse



          select Webs.FullUrl As SiteUrl, 
          case when [dirname] = ''
          then '/'+[leafname]
          else '/'+[dirname]+'/'+[leafname]
          end as [Page Url],
          CAST((CAST(CAST(Size as decimal(10,2))/1024 As
          decimal(10,2))/1024) AS Decimal(10,2)) AS 'File Size in MB'
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          where [type]=0
          and [leafname] like ('%.aspx')
          and [dirname] not like ('%_catalogs/%')
          and [dirname] not like ('%/Forms')
          and [content] is not null
          and [dirname] not like ('%Lists/%')
          and [setuppath] is not null
          order by [Page Url];



        • List of top level WSS sites and their total size, including child sites in the portal:

          Collapse



          select FullUrl As SiteUrl,  
          CAST((CAST(CAST(DiskUsed as decimal(10,2))/1024 As
          decimal(10,2))/1024) AS Decimal(10,2)) AS 'Total Size in MB'
          from sites
          Where FullUrl LIKE '%sites%' AND
          fullUrl <> 'MySite' AND fullUrl <> 'personal'



        • List of portal area and total number of users:

          Collapse



          select webs.FullUrl, Webs.Title, 
          COUNT(WebMembers.UserId) As 'Total User'
          from Webs INNER JOIN WebMembers
          ON Webs.Id = WebMembers.WebId
          Where fullurl NOT like '%sites%' AND
          fullUrl <> 'MySite' AND fullUrl <> 'personal'
          Group BY webs.FullUrl, Webs.Title
          Order By 'Total User' desc



        • List of top level and sub sites in the portal and the number of users:

          Collapse



          select  webs.FullUrl ,Webs.Title, COUNT(WebMembers.UserId) As 'Total User'
          from Webs INNER JOIN WebMembers
          ON Webs.Id = WebMembers.WebId
          where fullurl like '%sites%' AND fullUrl <> 'MySite' AND fullUrl <> 'personal'
          Group BY webs.FullUrl, Webs.Title
          Order By 'Total User' desc



        • List of all portal area:

          Collapse



          select Webs.FullUrl As [Site Url], 
          Title AS [Area Title]
          from Webs
          Where fullurl NOT like '%sites%' AND fullUrl <>
          'MySite' AND fullUrl <> 'personal'



        • List of the total portal area:

          Collapse



          select COUNT(*)from Webs 
          Where fullurl NOT like '%sites%' AND
          fullUrl <> 'MySite' AND fullUrl <> 'personal'



        • List of all top level and sub sites in the portal:

          Collapse



          select Webs.FullUrl As [Site Url], 
          Title AS [WSS Site Title]
          from webs
          where fullurl like '%sites%' AND fullUrl <>
          'MySite' AND fullUrl <> 'personal'



        • List of the total top level and sub sites in the portal:

          Collapse



          select COUNT(*) from webs
          where fullurl like '%sites%' AND fullUrl <>
          'MySite' AND fullUrl <> 'personal'



        • List of all list/document libraries and total items:

          Collapse



          select  
          case when webs.fullurl = ''
          then 'Portal Site'
          else webs.fullurl
          end as [Site Relative Url],
          webs.Title As [Site Title],
          case tp_servertemplate
          when 104 then 'Announcement'
          when 105 then 'Contacts'
          When 108 then 'Discussion Boards'
          when 101 then 'Docuemnt Library'
          when 106 then 'Events'
          when 100 then 'Generic List'
          when 1100 then 'Issue List'
          when 103 then 'Links List'
          when 109 then 'Image Library'
          when 115 then 'InfoPath Form Library'
          when 102 then 'Survey'
          when 107 then 'Task List'
          else 'Other' end as Type,
          tp_title 'Title',
          tp_description As Description,
          tp_itemcount As [Total Item]
          from lists inner join webs ON lists.tp_webid = webs.Id
          Where tp_servertemplate IN (104,105,108,101,
          106,100,1100,103,109,115,102,107,120)
          order by tp_itemcount desc


          Note: the tp_servertemplate field can have the following values:




          • 104  = Announcement


          • 105 = Contacts List


          • 108 = Discussion Boards


          • 101 = Document Library


          • 106 = Events


          • 100 = Generic List


          • 1100 = Issue List


          • 103 = Links List


          • 109 = Image Library


          • 115 = InfoPath Form Library


          • 102 = Survey List


          • 107 = Task List




        • List of document libraries and total items:

          Collapse



          select  
          case when webs.fullurl = ''
          then 'Portal Site'
          else webs.fullurl
          end as [Site Relative Url],
          webs.Title As [Site Title],
          lists.tp_title As Title,
          tp_description As Description,
          tp_itemcount As [Total Item]
          from lists inner join webs ON lists.tp_webid = webs.Id
          Where tp_servertemplate = 101
          order by tp_itemcount desc



        • List of image libraries and total items:

          Collapse



          select case when webs.fullurl = '' 
          then 'Portal Site'
          else webs.fullurl
          end as [Site Relative Url],
          webs.Title As [Site Title],
          lists.tp_title As Title,
          tp_description As Description,
          tp_itemcount As [Total Item]
          from lists inner join webs ON lists.tp_webid = webs.Id
          Where tp_servertemplate = 109 -- Image Library

          order by tp_itemcount desc



        • List of announcement list and total items:

          Collapse



          select case when webs.fullurl = '' 
          then 'Portal Site'
          else webs.fullurl
          end as [Site Relative Url],
          webs.Title As [Site Title],
          lists.tp_title As Title,
          tp_description As Description,
          tp_itemcount As [Total Item]
          from lists inner join webs ON lists.tp_webid = webs.Id
          Where tp_servertemplate = 104 -- Announcement List

          order by tp_itemcount desc



        • List of contact list and total items:

          Collapse



          select case when webs.fullurl = '' 
          then 'Portal Site'
          else webs.fullurl
          end as [Site Relative Url],
          webs.Title As [Site Title],
          lists.tp_title As Title,
          tp_description As Description,
          tp_itemcount As [Total Item]
          from lists inner join webs ON lists.tp_webid = webs.Id
          Where tp_servertemplate = 105 -- Contact List

          order by tp_itemcount desc



        • List of event list and total items:

          Collapse



          select case when webs.fullurl = '' 
          then 'Portal Site'
          else webs.fullurl
          end as [Site Relative Url],
          webs.Title As [Site Title],
          lists.tp_title As Title,
          tp_description As Description,
          tp_itemcount As [Total Item]
          from lists inner join webs ON lists.tp_webid = webs.Id
          Where tp_servertemplate = 106 -- Event List

          order by tp_itemcount desc



        • List of all tasks and total items:

          Collapse



          select  
          case when webs.fullurl = ''
          then 'Portal Site'
          else webs.fullurl
          end as [Site Relative Url],
          webs.Title As [Site Title],
          lists.tp_title As Title,
          tp_description As Description,
          tp_itemcount As [Total Item]
          from lists inner join webs ON lists.tp_webid = webs.Id
          Where tp_servertemplate = 107 -- Task List

          order by tp_itemcount desc



        • List of all InfoPath form library and total items:

          Collapse



          select  
          case when webs.fullurl = ''
          then 'Portal Site'
          else webs.fullurl
          end as [Site Relative Url],
          webs.Title As [Site Title],
          lists.tp_title As Title,
          tp_description As Description,
          tp_itemcount As [Total Item]
          from lists inner join webs ON lists.tp_webid = webs.Id
          Where tp_servertemplate = 115 -- Infopath Library

          order by tp_itemcount desc



        • List of generic list and total items:

          Collapse



          select  
          case when webs.fullurl = ''
          then 'Portal Site'
          else webs.fullurl
          end as [Site Relative Url],
          webs.Title As [Site Title],
          lists.tp_title As Title,
          tp_description As Description,
          tp_itemcount As [Total Item]
          from lists inner join webs ON lists.tp_webid = webs.Id
          Where tp_servertemplate = 100 -- Generic List

          order by tp_itemcount desc



        • Total number of documents:

          Collapse



          SELECT COUNT(*)
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1 AND (LeafName NOT LIKE '%.stp')
          AND (LeafName NOT LIKE '%.aspx')
          AND (LeafName NOT LIKE '%.xfp')
          AND (LeafName NOT LIKE '%.dwp')
          AND (LeafName NOT LIKE '%template%')
          AND (LeafName NOT LIKE '%.inf')
          AND (LeafName NOT LIKE '%.css')



        • Total MS Word documents:

          Collapse



          SELECT count(*)
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1 AND (LeafName LIKE '%.doc')
          AND (LeafName NOT LIKE '%template%')



        • Total MS Excel documents:

          Collapse



          SELECT count(*)
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1 AND (LeafName LIKE '%.xls')
          AND (LeafName NOT LIKE '%template%')



        • Total MS PowerPoint documents:

          Collapse



          SELECT count(*)
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1 AND (LeafName LIKE '%.ppt')
          AND (LeafName NOT LIKE '%template%')



        • Total TXT documents:

          Collapse



          SELECT count(*)
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1 AND (LeafName LIKE '%.txt')
          AND (LeafName NOT LIKE '%template%')



        • Total Zip files:

          Collapse



          SELECT count(*)
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1 AND (LeafName LIKE '%.zip')
          AND (LeafName NOT LIKE '%template%')



        • Total PDF files:

          Collapse



          SELECT count(*)
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1 AND (LeafName LIKE '%.pdf')
          AND (LeafName NOT LIKE '%template%')



        • Total JPG files:

          Collapse



          SELECT count(*)
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1 AND (LeafName LIKE '%.jpg')
          AND (LeafName NOT LIKE '%template%')



        • Total GIF files:

          Collapse



          SELECT count(*)
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1 AND (LeafName LIKE '%.gif')
          AND (LeafName NOT LIKE '%template%')



        • Total files other than DOC, PDF, XLS, PPT, TXT, Zip, ASPX, DEWP, STP, CSS, JPG, GIF:

          Collapse



          SELECT count(*)
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1 AND (LeafName NOT LIKE '%.pdf')
          AND (LeafName NOT LIKE '%template%')
          AND (LeafName NOT LIKE '%.doc')
          AND (LeafName NOT LIKE '%.xls')
          AND (LeafName NOT LIKE '%.ppt')
          AND (LeafName NOT LIKE '%.txt')
          AND (LeafName NOT LIKE '%.zip')
          AND (LeafName NOT LIKE '%.aspx')
          AND (LeafName NOT LIKE '%.dwp')
          AND (LeafName NOT LIKE '%.stp')
          AND (LeafName NOT LIKE '%.css')
          AND (LeafName NOT LIKE '%.jpg')
          AND (LeafName NOT LIKE '%.gif')
          AND (LeafName <>'_webpartpage.htm')



        • Total size of all documents:

          Collapse



          SELECT SUM(CAST((CAST(CAST(Size as decimal(10,2))/1024 
          As decimal(10,2))/1024) AS Decimal(10,2)))
          AS 'Total Size in MB'
          FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
          INNER JOIN Sites ON Webs.SiteId = SItes.Id
          WHERE
          Docs.Type <> 1 AND (LeafName NOT LIKE '%.stp')
          AND (LeafName NOT LIKE '%.aspx')
          AND (LeafName NOT LIKE '%.xfp')
          AND (LeafName NOT LIKE '%.dwp')
          AND (LeafName NOT LIKE '%template%')
          AND (LeafName NOT LIKE '%.inf')
          AND (LeafName NOT LIKE '%.css')
          AND (LeafName <>'_webpartpage.htm')


        Sunday, August 1, 2010

        Shorting the content DB from enumlist.txt

        this morning try to get the URL and Database from enumlist for orphan object checking , but after import to excel with delimited but look like the information is not good enough. ha ha, then learnt some excel function to short it out. so want to keep track new excel command i learnt :

         

        <Site Url=http://abc.abc.com Owner="abc\abc" ContentDatabase="MOSS_Content_DB1" StorageUsedMB="28.7" StorageWarningMB="80" StorageMaxMB="100" />

         

        this command is trim up the front part

        =RIGHT(A1,LEN(A1)-FIND("e=",A1))

         

        Results is :

        ="MOSS_Content_DB1" StorageUsedMB="28.7" StorageWarningMB="80" StorageMaxMB="100" />

         

        Another column  is trim out the left over

        =LEFT(B2,(FIND("St",B2)))

         

        Results is:

        ="MOSS_Content_DB1" S

         

        At last replace the “ and “ S with space, then you will get the DB name :)

         

        Maybe look stupid , but i get what i want!! i think will have more easy way , but i unable to think out yet. so i just use the faster skill i know to get my information i think this is fair.

         

        please do share with me the easy way , if you have :)