Archive for July 2013

How To Get SharePoint Site and Web Guids   Leave a comment

I received a request to export a list of all SharePoint Site Collection GUIDs. Each Site Collection (Site)and Sub-Site (Web) contains a GUID (Global Unique Identifier).

This script below will enumerate through a Web Application and export the Site Guids to a
Comma Delimited File (.csv).

Simply copy this script and Save as SP-ExportSiteAndWebGuids.ps1

#***********************************************************************************
#* Author: Paul D. Fox
#* Date: 07/04/2013
#* Description: PowerShell Script to List Site and Web GUIDs.
#*
#* Purpose: This PowerShell Script will Export all of the SharePoint Site and Web GUIDs to a
#* Comma Delimited file.
#*
#* Modifications: MM/DD/YYYY – Description
#*
#* Execution: To run this script Open the PowerShell Snap-in navigate to the directory where
#* this script resides and type the following: .\SP-ExportSiteAndWebGuids.ps1
#* Note: List must reside prior to executing this script
#*
#**********************************************************************************

#Reference the SharePoint Assembly
[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)

### Begin Variables ###
$webApplicationUrl=Read-Host `n`n”Type the Url of the Web Application you wish to get Site and Web GUIDs”`n
### End Variables ###

#Set Output File
set-variable -option constant -name out -value “C:\DisplaySiteWebGuids.csv”

$webapplication = Get-SPWebApplication $webApplicationUrl

#Enumerate each Site (Site Collection)
foreach($site in $webapplication.Sites){
#Enumerate each Web (Site)

foreach($web in $site.AllWebs){
write-host $web.title “:” $spweb.URL
write-host $web.id
“Web Title: ” + $web.title | Out-File $out -Append
“Web : ” + $web.Url | Out-File $out -Append
“Web Id: ” + $web.id | Out-File $out -Append
}
}
Write-Host “Script Completed!”

Enjoy!

Posted July 26, 2013 by Bismarck in PowerShell

Hello World!   Leave a comment

Welcome to my first Blog.  I will be sharing my experiences working with Microsoft Software. Stay tuned for more to come

Posted July 22, 2013 by Bismarck in Uncategorized