xud6的笔记本

windows

A 24 post collection


Powershell 卸载程序

 •  Filed under windows, powershell
function Uninstall-Application {
    $appName = $($args[0])
    Write "application to uninstall: $appName"
    $uninstall32 = gci "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -Match $appName }
    $uninstall64 = gci "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match $appName }

    if($uninstall32){
        if($uninstall32.QuietUninstallString){
            Write ("uninstall32 Quiet: " + $uninstall32.QuietUninstallString)
            Start-Process -FilePath cmd.exe -ArgumentList '/c', $uninstall32.QuietUninstallString  -Wait
        }else{
            Write ("uninstall32 Normal: " + $uninstall32.UninstallString)
            Start-Process -FilePath cmd.exe -ArgumentList '/c', $uninstall32.UninstallString  -Wait
        }
    }
    if($uninstall64){
        if($uninstall64.QuietUninstallString){
            Write ("uninstall64 Quiet: " + $uninstall64.QuietUninstallString)
            Start-Process -FilePath cmd.exe -ArgumentList '/c', $uninstall64.QuietUninstallString  -Wait
        }else{
            Write ("uninstall64 Normal: " + $uninstall64.UninstallString)
            Start-Process -FilePath cmd.exe -ArgumentList '/c', $uninstall64.UninstallString  -Wait
        }
    }
}

Uninstall-Application("application name*")

远程桌面服务通过远程桌面网关访问时提示发生验证错误(代码:0x607)

 •  Filed under windows, RemoteDesktopService, RDS

错误出现在远程桌面连接代理认证成功,连接至分配的远程桌面会话主机时。如果直接通过远程桌面网关访问远程桌面会话主机或者不通过远程桌面网关都正常
同时远程桌面会话主机的RemoteDesktopService-RdpCoreTS日志出现TCP 套接字读取操作失败,出现错误 64

原因为远程桌面会话主机上的证书有问题。
检查并删除 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\SSLCertificateSHA1Hash (如果存在)
检查组策略计算机配置/策略/管理模板/Windows 组件/远程桌面服务/远程桌面会话主机/安全/服务器身份验证证书模板确保未设置

更改后重启即可恢复

Veeam Agent for Microsoft Windows 清除本地设置和状态

 •  Filed under windows, veeam
  1. 停止VeeamEndpointBackupSvc服务
  2. 删除 C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\VeeamEndPoint 文件夹
  3. 删除 C:\ProgramData\Veeam\EndpointData 文件夹
  4. 将注册表 HKEY_LOCAL_MACHINE\Software\Veeam\Veeam Endpoint Backup\RecreateDatabase 设为 "1"
  5. 启动VeeamEndpointBackupSvc服务

清理 GPO 中 Extra Registry Settings

 •  Filed under Active Directory, windows

对于Office Deployment中Setting值为Software\Policies\Microsoft\Office\11.0\Word\DisabledCmdBarItemsCheckBoxes\FileOpenToolsFind的项,如果在User Configuration中

Remove-GPRegistryValue -Name "Office Deployment" -Key "HKCU\Software\Policies\Microsoft\Office\11.0\Word\DisabledCmdBarItemsCheckBoxes" -ValueName "FileOpenToolsFind"

对应的如果在Computer Configuration中应把HKCU换为HKLM

Powershell 转移 FSMO

 •  Filed under Active Directory, windows

获取当前FSMO

Get-ADForest | select SchemaMaster,DomainNamingMaster
Get-ADDomain | select PDCEmulator,RIDMaster,InfrastructureMaster

转移FSMO

Move-ADDirectoryServerOperationMasterRole -Identity <Target-DC> -OperationMasterRole SchemaMaster,RIDMaster,InfrastructureMaster,DomainNamingMaster,PDCEmulator

强制转移FSMO

Move-ADDirectoryServerOperationMasterRole -Identity <Target-DC> -OperationMasterRole SchemaMaster,RIDMaster,InfrastructureMaster,DomainNamingMaster,PDCEmulator -Force