Ir al contenido principal

Entradas

Mostrando entradas de octubre, 2018

PowerShell - SPOnPremise - Calculate and Set Distributed Cache Size

#calculation from:  http://technet.microsoft.com/en-us/library/jj219613.aspx $membanks = get-wmiobject Win32_PhysicalMemory $sum = 0 $i = 1 foreach ( $membank in $membanks ) {   write-host "Capacity Memory $i = " ( $membank . capacity / 1024 / 1024 )   $sum = ( $membank . capacity / 1024 / 1024 ) + $sum   $i = $i + 1 } write-host "Sum of Memory = " $sum $cachesize = ( $sum - 2048 ) / 2 if ( $cachesize > 16384 )   {   $cachesize = 16384 #not more than 16GB   } write-host "Distributed Cachesize will be updated to: " $cachesize #Update-SPDistributedCacheSize -CacheSizeInMB $cachesize Fuente: https://blogs.technet.microsoft.com/sp/?p=213 

PowerShell - SharePointOnline - Queries the active site collections in O365 tenant to generate reports based on template type used by the site collection

# Requires Windows PowerShell version 3 $tenant = "" <#   Description:     Queries the active site collections in O365 tenant to generate reports based on template type used     by the site collection. And will generate report with all site collections in tenant.     Details of the discovered sites are written to a .csv file for each template type.     The .csv files will be found in the directory the script is ran from.   Requirements:     SharePoint Online Management Shell - Current build     http://www.microsoft.com/en-us/download/details.aspx?id=35588 ============================================================== #> # Set tenant values $SPOAdminCenter = "https:// $tenant -admin.sharepoint.com" $AdminCredential = "" #Report Files Names $reportNameGroups = "GroupsSiteInfo_ $(( Get-Date ) . ToString( "yyyy-MM-dd_hh.mm.ss" )) .csv" $reportNameOD4B = "OneDriveForBusine

PowerShell - Get Database Size for all SharePoint DBs via PowerShell

Get Database Size for all SharePoint DBs via PowerShell Add-PSSnapin microsoft.sharepoint.powershell $size = 0 foreach ( $db in Get-SPContentDatabase ) {     $size = $size + $db . DiskSizeRequired } $cdbs = "{0:N2}" -f ( $size / 1gb ) $ssa = Get-SPEnterpriseSearchServiceApplication $topo = $ssa | Get-SPEnterpriseSearchTopology   -Active $indexcomponent = ( Get-SPEnterpriseSearchComponent -SearchTopology $topo | ? { $_ . name -like "*index*" }) [ 0 ] $folder = $indexcomponent . RootDirectory $indexsize = "{0:N2}" -f (( Get-ChildItem $folder -Recurse | Measure-Object -sum   Length ) . sum / 1GB ) $dbs = Get-SPDatabase cls write-host "--------------------------------------------------------------------------------------" -fore green Get-Date write-host "" write-host "--------------------------------------------------------------------------------

[IIS] Delete IIS Logs Using Task Scheduler

Deletes IIS log files that are more than "n" days old with Task Scheduler - Without VB and PS Scripts.Run Task Scheduler using the Windows interface Click the Start button. Click Control Panel . Click System and Maintenance . Click Administrative Tools . Double-click Task Sche Deletes IIS log files that are more than  n  days old with Task Scheduler - Without VB and PS Scripts. Run Task Scheduler using the Windows interface Click the  Start  button. Click  Control Panel  . Click  System and Maintenance  . Click  Administrative Tools  . Double-click  Task Scheduler  . To Run Task Scheduler from the Command Line Open a command prompt. To open a command prompt, click  Start  , click  All Programs  , click  Accessories  , and then click  Command Prompt  . At the command prompt, type  Taskschd.msc  . Create new Task and specify"Start a program" in Actions Tab, enter " forfiles"  in "Program/script:" section. And " /p