Инструменты пользователя

Инструменты сайта


howto:windows:powershell

Различия

Здесь показаны различия между двумя версиями данной страницы.

Ссылка на это сравнение

Следующая версия
Предыдущая версия
howto:windows:powershell [2017/01/27 11:41]
Алексей Кожевников создано
howto:windows:powershell [2019/01/17 10:56] (текущий)
Алексей Кожевников
Строка 1: Строка 1:
-====== powershell ======+====== ​cmd / powershell ======
  
 Starting a Remote Session Starting a Remote Session
  
-<​code>​Enter-PSSession -ComputerName COMPUTER -Credential ​USER</​code>​+<​code>​Enter-PSSession -ComputerName COMPUTER -Credential ​Administrator</​code>​ 
 + 
 +Прибить все процессы пользователя SRV\Administrator 
 + 
 +<​code>​taskkill /s SRV /u SRV\Administrator /p pass /F /FI "​USERNAME eq SRV\Administrator"​ /IM *</​code>​ 
 + 
 +Текущая дата 
 +<​code>​ 
 +$d = Get-Date -format yyyyMMdd 
 +</​code>​ 
 + 
 +Листинг файлов в каталоге по маске:​ 
 +<​code>​Get-Childitem -Path C:\test -Recurse -Include "​*$($d)000.BAK"</​code>​ 
 + 
 +Удаление логов старше года: 
 +<​code>​Forfiles -p C:\logs -s -m *.* -d -365 -c "cmd /c del /q @path"</​code>​ 
 + 
 +====== TS ====== 
 + 
 +Displays information about sessions on a terminal server 
 +<​code>​query session [{SessionName|UserName|SessionID}] [/​server:​ServerName] [/mode] [/flow] [/connect] [/​counter]</​code>​ 
 + 
 +https://​technet.microsoft.com/​en-us/​library/​cc754340(v=ws.11).aspx
  
 {{tag> windows powershell }} {{tag> windows powershell }}
howto/windows/powershell.1485506473.txt.gz · Последние изменения: 2017/01/27 11:41 — Алексей Кожевников