Windows

安装OpenSSH for Windows

下面是在powershell中操作的命令记录 choco install powershell-core -y choco install openssh cd C:\Program Files\OpenSSH-Win64 Set-ExecutionPolicy RemoteSigned #设置默认shell为powershell .\Set-SSHDefaultShell.ps1 -PathSpecsToProbeForShellEXEString "\$env\:userprofile\downloads\*.exe;c:\Program Files\PowerShell\*\P\*.exe;c:\windows\system32\*" #配置认证用autho

Windows 用户只能注销,不能关机或重启

我的一台笔记本电脑因为某些原因(主动)退域了,之后就出现了一个问题,开始菜单里面只有“注销”,没有其他选项。使用shutdown -s -t 0或者restart-computer -force提示没有特权。注销用户之后就可以关闭或者重启电脑了。

只有注销

删除Windows用户Profile

Get-WMIObject -class Win32_UserProfile | Where {!$_.Special -and !$_.Loaded } | Remove-WmiObject