Win2012: различия между версиями
Материал из support.qbpro.ru
imported>Vix Нет описания правки |
Vix (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
==Как сменить тип профиля сети в Windows Server 2012== | |||
secpol.msc | secpol.msc | ||
* Нажмите кнопку OK, нажмите Политики диспетчера списка сетей, нажмите на нужной сети правой кнопкой мыши, выберите Свойства, перейдите на вкладку Сетевое расположение, установите отметку Публичное, нажмите кнопку OK. | * Нажмите кнопку OK, нажмите Политики диспетчера списка сетей, нажмите на нужной сети правой кнопкой мыши, выберите Свойства, перейдите на вкладку Сетевое расположение, установите отметку Публичное, нажмите кнопку OK. | ||
==Очистка кэшей и временных файлов на терминальном сервере== | |||
``` | |||
$users = Get-ChildItem -Path C:\Users | select Name | |||
function Clear-CacheFolder { | |||
[CmdletBinding()] | |||
param( | |||
[Parameter(Mandatory = $true)] | |||
[string]$CachePath | |||
) | |||
Write-Host $CachePath | |||
if (Test-Path -LiteralPath $CachePath) { | |||
Get-ChildItem -LiteralPath $CachePath -Force | | |||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue | |||
} | |||
} | |||
#ETLLogs | |||
$cachePath ="C:\ProgramData\Microsoft\Diagnosis\ETLLogs\" | |||
$days = 5 | |||
$limit = (Get-Date).AddDays(-$days) | |||
Get-ChildItem -LiteralPath $cachePath -Recurse -Force -File | | |||
Where-Object { $_.LastWriteTime -lt $limit } | | |||
Remove-Item -Force -ErrorAction SilentlyContinue | |||
foreach ($y in $users) | |||
{ | |||
Write-Host $y.Name | |||
$u=$y.Name | |||
#Get-ChildItem -Path "c:\users\"$u"\AppData\Local\Yandex\YandexBrowser\User Data\Default\Cache\" | |||
#yandex | |||
$cachePath = "c:\users\"+$u+"\AppData\Local\Yandex\YandexBrowser\User Data\Default\Cache\" | |||
Clear-CacheFolder -CachePath $cachePath | |||
$cachePath = "c:\users\"+$u+"\AppData\Local\Yandex\YandexBrowser\User Data\Default\Code Cache\" | |||
Clear-CacheFolder -CachePath $cachePath | |||
#opera | |||
$cachePath = "c:\users\"+$u+"\AppData\Local\Opera\Opera\cache\" | |||
Clear-CacheFolder -CachePath $cachePath | |||
$cachePath = "c:\users\"+$u+"\AppData\Local\Opera\Opera\code cache\" | |||
Clear-CacheFolder -CachePath $cachePath | |||
#chrome | |||
$cachePath = "c:\users\"+$u+"\AppData\Local\Google\Chrome\User Data\Default\Cache\" | |||
Clear-CacheFolder -CachePath $cachePath | |||
$cachePath = "c:\users\"+$u+"\AppData\Local\Google\Chrome\User Data\Default\Code Cache\" | |||
Clear-CacheFolder -CachePath $cachePath | |||
#thumbvache | |||
$cachePath = "c:\users\"+$u+"\AppData\Local\Microsoft\Windows\Explorer\" | |||
Clear-CacheFolder -CachePath $cachePath | |||
#temp | |||
$cachePath = "c:\users\"+$u+"\AppData\Local\temp\" | |||
Clear-CacheFolder -CachePath $cachePath | |||
} | |||
``` | |||
* [https://carnolio.com/ochistka-keshej-i-vremennyx-fajlov-na-terminalnom-servere/ Источник] | |||
'''ИСТОЧНИК:''' | '''ИСТОЧНИК:''' | ||
<hr> | <hr> | ||
Версия от 15:32, 12 октября 2026
Как сменить тип профиля сети в Windows Server 2012
secpol.msc
- Нажмите кнопку OK, нажмите Политики диспетчера списка сетей, нажмите на нужной сети правой кнопкой мыши, выберите Свойства, перейдите на вкладку Сетевое расположение, установите отметку Публичное, нажмите кнопку OK.
Очистка кэшей и временных файлов на терминальном сервере
``` $users = Get-ChildItem -Path C:\Users | select Name
function Clear-CacheFolder {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$CachePath
)
Write-Host $CachePath
if (Test-Path -LiteralPath $CachePath) {
Get-ChildItem -LiteralPath $CachePath -Force |
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
}
}
- ETLLogs
$cachePath ="C:\ProgramData\Microsoft\Diagnosis\ETLLogs\" $days = 5 $limit = (Get-Date).AddDays(-$days) Get-ChildItem -LiteralPath $cachePath -Recurse -Force -File |
Where-Object { $_.LastWriteTime -lt $limit } |
Remove-Item -Force -ErrorAction SilentlyContinue
foreach ($y in $users) {
Write-Host $y.Name $u=$y.Name #Get-ChildItem -Path "c:\users\"$u"\AppData\Local\Yandex\YandexBrowser\User Data\Default\Cache\"
- yandex
$cachePath = "c:\users\"+$u+"\AppData\Local\Yandex\YandexBrowser\User Data\Default\Cache\" Clear-CacheFolder -CachePath $cachePath $cachePath = "c:\users\"+$u+"\AppData\Local\Yandex\YandexBrowser\User Data\Default\Code Cache\" Clear-CacheFolder -CachePath $cachePath
- opera
$cachePath = "c:\users\"+$u+"\AppData\Local\Opera\Opera\cache\" Clear-CacheFolder -CachePath $cachePath $cachePath = "c:\users\"+$u+"\AppData\Local\Opera\Opera\code cache\" Clear-CacheFolder -CachePath $cachePath
- chrome
$cachePath = "c:\users\"+$u+"\AppData\Local\Google\Chrome\User Data\Default\Cache\" Clear-CacheFolder -CachePath $cachePath $cachePath = "c:\users\"+$u+"\AppData\Local\Google\Chrome\User Data\Default\Code Cache\" Clear-CacheFolder -CachePath $cachePath
- thumbvache
$cachePath = "c:\users\"+$u+"\AppData\Local\Microsoft\Windows\Explorer\" Clear-CacheFolder -CachePath $cachePath
- temp
$cachePath = "c:\users\"+$u+"\AppData\Local\temp\" Clear-CacheFolder -CachePath $cachePath
} ```
ИСТОЧНИК:
ПОЛЕЗНОЕ:
