Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Powershell Script to Get the List of Available SharePoint Quota Templates
WhatsApp
Karthik Muthu Karuppan
Jan 28
2015
2.7
k
0
0
AvailableQuotaTempla
$LogTime = Get-Date -Format yyyy-MM-dd_hh-mm
$LogFile =
".\AvailableQuotaTemplatesPatch-$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-host
"Get quota templates in Quota Template Collection ..."
$quotaTemplates = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.QuotaTemplates
Write-Output $quotaTemplates
}
catch
[Exception] {
Write-Error $Error[0]
$err = $_.Exception
while
( $err.InnerException ) {
$err = $err.InnerException
Write-Output $err.Message
}
}
SharePoint
Quota Templates
Up Next
Powershell Script to Get the List of Available SharePoint Quota Templates