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

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


Боковая панель


Программное обеспечение
Черновики


Краткая инструкция

howto:windows:powershell

cmd / powershell

Starting a Remote Session

Enter-PSSession -ComputerName COMPUTER -Credential Administrator

Прибить все процессы пользователя SRV\Administrator

taskkill /s SRV /u SRV\Administrator /p pass /F /FI "USERNAME eq SRV\Administrator" /IM *

Текущая дата

$d = Get-Date -format yyyyMMdd

Листинг файлов в каталоге по маске:

Get-Childitem -Path C:\test -Recurse -Include "*$($d)000.BAK"

Удаление логов старше года:

Forfiles -p C:\logs -s -m *.* -d -365 -c "cmd /c del /q @path"

TS

Displays information about sessions on a terminal server

query session [{SessionName|UserName|SessionID}] [/server:ServerName] [/mode] [/flow] [/connect] [/counter]

https://technet.microsoft.com/en-us/library/cc754340(v=ws.11).aspx

howto/windows/powershell.txt · Последние изменения: 2019/01/17 10:56 — Алексей Кожевников