命令语句(CMD表示MS-Dos,PS表示PowerShell,REG表示Regedit)
- 远程桌面连接出现“CredSSP 加密 Oracle修正”
- 运行 gpedit.msc 命令,浏览到 “计算机配置 --> 管理模板 --> 系统 --> 凭据分配 --> 加密 Oracle 修正”,选择 “已启用 --> 易受攻击” 选项,应用保存即可;
- 或者通过命令行以管理员身份运行以下命令:
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters" /t REG_DWORD /v AllowEncryptionOracle /d "0x00000002" /f - 访问共享文件夹,提示 “因为你组织的安全策略阻止未经身份验证的来宾访问”
- 运行 gpedit.msc 命令,浏览到 “计算机配置 --> 管理模板 --> 网络 --> Lanman 工作站 --> 启用不安全的来宾登录”,选择 “已启用” 选项,应用保存并重启 Workstation 服务;
- 或者通过命令行以管理员身份运行以下命令(请使用 PowerShell 命令重启服务,可以重启依赖服务):
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation" /t REG_DWORD /v AllowInsecureGuestAuth /d "0x00000001" /f
net stop LanmanWorkstation /y && net start LanmanWorkstation
Restart-Service LanmanWorkstation -Force - PowerShell 如何实现批量测试邮件发送
- 如何将 .evtx 日志转换为 .csv 格式
- 安装 Log Parser 2.2(必选免费) | Log Parser Studio(可选免费) | Log Parser Lizard(可选收费)
- 执行
wevtutil epl System D:\System.evtx
LogParser "SELECT TimeGenerated, ComputerName, EventTypeName, SourceName, Message, EventId INTO D:\System.csv FROM D:\System.evtx" -i:EVT - 或者
wevtutil epl System D:\System.evtx
$a = Get-Item "D:\*.evtx"
foreach($file in $a)
{
Get-WinEvent -Path $file.FullName | SELECT TimeCreated, MachineName, LevelDisplayName, ProviderName, Message, Id | Export-Csv -Encoding UTF8 -UseCulture $file.FullName.replace(".evtx",".csv")
} - ".NET 4.6.2 安装时出现:无法建立到信任根颁发机构的证书链"
- 下载 MicrosoftRootCertificateAuthority2011.cer 证书并导入到“受信任的根证书颁发机构”
- “Windows 2012 RDS 服务器上,通过 mstsc /shadow 来协助其他用户”
- 执行
quser
或qwinsta
命令来查看当前服务器上的所有远程会话信息; - 执行
mstsc /shadow:2 /control
命令来协助会话 ID 为 2 的用户; - 会话 ID 为 2 的用户需要手动确认协助请求。
- 配置了 SSD 和 HDD 的服务器,直接使用 SSD 安装系统时、默认会将 BOOT 分区创建在 HDD 磁盘上
- 在 BIOS 设置中将 HDD 磁盘离线,再进行系统安装;
- 或者通过 diskpart 命令创建独立分区来安装系统;
diskpart
DISKPART>list disk
DISKPART>select disk 0
DISKPART>clean
DISKPART>create partition primary size=51200
DISKPART>list partition
DISKPART>select partition 1
DISKPART>active
DISKPART>format fs=ntfs quick
- BAT 批量检查磁盘
- 运行程序提示缺失"MSVCP140_CODECVT_IDS.dll"和"MSVCR110.dll"文件
- "MSVCP140_CODECVT_IDS.dll"需要下载并安装 Visual C++ Redistributable for Visual Studio 2015-2022
- "MSVCR110.dll"需要下载并安装 Visual C++ Redistributable for Visual Studio 2012 Update 4
- Windows 照片查看器无法打开此图片,因为此文件可能已损坏、损毁或过大。
- 由于手动清理了 %TEMP% 或 %TMP% 目录导致程序找不到缓存路径
- 执行
mkdir "%TEMP%"
命令手动创建缓存目录
1 2 3 4 5 6 |
for ( $i = 1; $i -le 10; $i++ ) { Send-MailMessage -Subject "Test E-mail NO.$i" -Body "This is test $i mail." -From administrator@test.com -To "desen@test.com" -Cc "test5@test.com", "test6@test.com" -Attachments "E:\Doc\UltraPath.pdf" -SmtpServer EXGML01.test.com Write-Host -ForegroundColor "Green" "Starting script, Sending Email NO.$i to Recipients....." sleep 2 } |
或者
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
function sendmail_withAttachment { Param ( [string] $smtpServer = "EXGML01.test.com", [string] $From_mail = "administrator@test.com", [string] $To_mail = "desen@test.com", [string] $Cc_mail = "test5@test.com, test6@test.com", [string] $Date = $(Get-Date -uFormat "%Y%m%d"), [string] $Subject = "$Date Test E-mail NO.$i" ) Write-Host -ForegroundColor "Green" "Starting script, Sending Email NO.$i to Recipients....." $text = "Attached is the email server mailbox report" $body = "<font color=red><b>$text</b></font><br><br>" $body += "<br>-----------------------------------------------------------------<br>" $body += "<footer><font size=2>Contact IT Team if you have any question.</font></footer>" $body += "<br>-----------------------------------------------------------------<br>" $file= "E:\Doc\UltraPath.pdf" $att = new-object Net.Mail.Attachment($file) $msg = new-object Net.Mail.MailMessage $smtp = new-object Net.Mail.SmtpClient($smtpServer) $msg.IsBodyHTML = $true $msg.Body = $body $msg.From = $From_mail $msg.To.Add($To_mail) $msg.CC.Add($Cc_mail) $msg.Subject = $Subject $msg.Attachments.Add($att) $smtp.Send($msg) $att.Dispose() } for ( $i = 1; $i -le 10; $i++ ) { sendmail_withAttachment sleep 2 } |
1 2 3 4 5 6 7 |
@ECHO OFF FOR %%d IN (Z,W,V,Q,P,O,N,M,K,J,L,H,F,E) DO ( ECHO; ECHO 开始检查盘符 %%d: CHKDSK /OfflineScanAndFix /SDCleanUp /X /V %%d: ) PAUSE |
文章出自: 本站技术文章均为原创,版权归 "Desen往事 - 个人博客" 所有;部分图片来源于 Yandex ,转载本站文章请注明来源。
本文标题:Windows 问题记录