Hi, Today I found this excellent script for the job. All the credit goes to http://jasonwarren.ca/clearspconfigcache/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
<# .SYNOPSIS Clear the Configuration Cache in a SharePoint 2010, 2013, or 2016 farm .DESCRIPTION Clear-SPConfigCache.ps1 will: 1. Stop the SharePoint Timer Service on all servers in the farm 2. Delete all xml files in the configuration cache folder on all servers in the farm 3. Copy the existing cache.ini files as a backup 4. Clear the cache.ini files and reset them to a value of 1 5. Start the SharePoint Timer Service on all servers in the farm Clear-SPConfigCache.ps1 will work in either single-server and multi-server farms. Run in an elevated SharePoint Management Shell Author: Jason Warren .LINK http://jasonwarren.ca/ClearSPConfigCache ClearSPConfigCache.ps1 .EXAMPLE .\Clear-SPConfigCache.ps1 .INPUTS None. Clear-SPConfigCache.ps1 does not take any input. .OUTPUTS Text output that describes the current task being performed. #> Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop $farm = Get-SPFarm $ConfigDB = Get-SPDatabase | where {$_.Name -eq $Farm.Name} # Configuration Cache is stored in %PROGRAMDATA\Microsoft\SharePoint\Config\[Config ID GUID] # %PROGRAMDATA% is C:\ProgramData by default, it is assumed it's in the same location on all servers in the farm # i.e. if it's X:\ProgramData on one server, it will be X:\ProgramData on the others # We'll be connecting via UNC paths, so we'll also change the returned DRIVE: to DRIVE$ $ConfigPath = "$(($env:PROGRAMDATA).Replace(':','$'))\Microsoft\SharePoint\Config\$($ConfigDB.Id.Guid)" # Stop the timer service on all farm servers $TimerServiceName = "SPTimerV4" foreach ($server in $farm.TimerService.Instances.Server) { Write-Output "Stopping $TimerServiceName on $($server.Address)..." $service = Get-Service -ComputerName $server.Address -Name $TimerServiceName Stop-Service -InputObject $service -Verbose } # Foreach server $TimeStamp = Get-Date -Format "yyyymmddhhmmssms" # Clear and reset the cache on each server in the farm foreach ($server in $farm.TimerService.Instances.Server) { Write-Output $server.Address # build the UNC path e.g. \\server\X$\ProgramData\Microsoft\SharePoint\Config\00000000-0000-0000-0000-000000000000 $ServerConfigPath = "\\$($server.Address)\$($ConfigPath)" # Delete the XML files Write-Output "Remove XML files: $ServerConfigPath..." Remove-Item -Path "$ServerConfigPath\*.xml" # Backup the old cache.ini Write-Output "Backup $ServerConfigPath\cache.ini..." Copy-Item -Path "$ServerConfigPath\cache.ini" -Destination "$ServerConfigPath\cache.ini.$TimeStamp" # Save the value of "1" to cache.ini Write-Output "Set cache.ini to '1'..." "1" | Out-File -PSPath "$ServerConfigPath\cache.ini" Write-Output "" } #foreach server #Start the timer service on all farm servers foreach ($server in $farm.TimerService.Instances.Server) { Write-Output "Starting $TimerServiceName on $($server.Address)..." $service = Get-Service -ComputerName $server.Address -Name $TimerServiceName Start-Service -InputObject $service -Verbose } |
If You want to archive this You have to use Powershell. Connect to Exchange Online Powershell and use the command below:
1 |
Set-UnifiedGroup -Identity GroupMailboxIdentity@domain.fi -EmailAddresses @{Add='alias@domain.fi'} |
Happy Powershelling,
Sharepoint gathers usage and health data to database called WSS_Logging. By Default retention period is 14 days. If You want to make it lower, lets say 2 days use the below oneliner for it.
1 |
Get-SPUsageDefinition | Set-SPUsageDefinition -DaysRetained 2 |
And then just a quick…
If You have to get something out to a csv-file from Direct Access Reporting. You have to use powershell. For the last 30 days use below script.
1 2 3 4 5 |
$startdate = (Get-Date).AddDays(-30) $enddate = Get-Date Get-RemoteAccessConnectionStatistics –StartDateTime $startdate –EndDateTime $enddate | Export-Csv -nti -enc utf8 –Path c:\dir\da.csv |
Here is a small guide, on how to get started with Windows Autopilot. First thing that you need to make sure, is that you have the following prerequisites: Devices must be registered to the organization Devices have to be pre-installed…
Customizing Windows 10 Start-Menu and Taskbar is quite simple, all you need is a reference machine and some Powershell skills. First thing you want to do is to set up your reference machine with the customizations you want to create….
Updates have been released for Exchange 2013 and 2016. https://blogs.technet.microsoft.com/exchange/2017/09/19/released-september-2017-quarterly-exchange-updates/ If You are using a Hybrid, You have to update these to be supported.
Hi, Today a customer call me and said that they cannot connect to meeting. In the Blog below is the fix. https://blogs.technet.microsoft.com/uclobby/2017/05/24/lyncsfb-server-event-41026-ls-data-mcu-after-may-2017-net-framework-update/ And script that does this for You. https://gallery.technet.microsoft.com/LyncSfB-Server-Disable-EKU-dab6cb88
So You see this error in NDR when the message bounces back. In my case I had a normal AD User with mail-attribute populated. Exchange figured out that this user has a mailbox inside the organization. It wasn’t. The user…
It is common knowledge that for sysprep, you need to remove AppX packages from Windows 10 (and 8/8.1). The best way to do it, is to remove them directly from the installation media, so they never get installed in the…