常用脚本大全

  Scripts-脚本

Ping命令导出到文档并显示时间:

ping.exe -t 192.168.2.10 |Foreach{“{0} – {1}” -f(Get-Date),$_}>C:\Temp\ping.txt

修复Win10网络图片显示异常,可以上网问题:

Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet\
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet -Name “ActiveWebProbeContent” -Value “Microsoft NCSI” -Force
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet -Name “ActiveWebProbeContentV6” -Value “Microsoft NCSI” -Force
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet -Name “ActiveWebProbeHost” -Value “www.msftncsi.com” -Force
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet -Name “ActiveWebProbeHostV6” -Value “ipv6.msftncsi.com” -Force
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet -Name “ActiveWebProbePath” -Value “ncsi.txt” -Force
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet -Name “ActiveWebProbePathV6” -Value “ncsi.txt” -Force
Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet\
Get-NetAdapter |Restart-NetAdapter

Microsoft Autopilot手机硬件信息(不带Autopilot芯片的电脑):

Set-ExecutionPolicy Bypass
Install-Script Get-WindowsAutoPilotInfo
Get-WindowsAutoPilotInfo -Outputfile C:\AutoPilotHWID.csv

LEAVE A COMMENT