TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Powershell Scipt to Find Farm Scoped Features
Karthik Muthu Karuppan
Jan 27
2015
Code
742
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
FindFarmScopedFeatur
$LogTime = Get-Date -Format yyyy-MM-dd_hh-mm
$LogFile =
".\FarmScopedFeaturePatch-$LogTime.rtf"
# Add SharePoint PowerShell Snapin
if
( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $
null
) {
Add-PSSnapin Microsoft.SharePoint.Powershell
}
$scriptBase = split-path $SCRIPT:MyInvocation.MyCommand.Path -parent
Set-Location $scriptBase
#Deleting any .rtf files in the scriptbase location
$FindRTFFile = Get-ChildItem $scriptBase\*.* -include *.rtf
if
($FindRTFFile)
{
foreach($file
in
$FindRTFFile)
{
remove-item $file
}
}
start-transcript $logfile
try
{
Write-Verbose
"Getting Farm Scope Features..."
$features = Get-SPFeature -Farm -Limit All | Sort-Object DisplayName
Write-Output $features
}
catch
[Exception] {
Write-Error $Error[0]
$err = $_.Exception
while
( $err.InnerException ) {
$err = $err.InnerException
Write-Output $err.Message
}
}
stop-transcript
script
SharePoint
Farm Scoped Features