想要根据xml文件筛选器读取远程主机最新的几条日志,结果老是提示:
error : wevtutil qe systemquery.xml /f:text /rd:true /c:3 /sq:true /r:\\******* /u:*********\administrator /p:************
没仔细看原来指定了远程主机时,不能加\\,估计是这个命令不支持吧,systeminfo 远程读取带 \\ 是可以的。正确命令:
wevtutil qe systemquery.xml /sq:true /f:text /rd:true /c:1 /r:********* /u:***********\administrator /p:**********
本以为这样就好了:
其中的systemquery.xml
*[system[(level=2 or level=3 or level=5)]]
在开头缺少了xml文件的指定。添加后的systemquery.xml
*[system[(level=2 or level=3 or level=5)]]
查询开始:
可以看到有这两个错误:
在没有配置的 dns 服务器响应之后,名称 server23.localdomain 的名称解析超时。
在没有配置的 dns 服务器响应之后,名称 wpad.localdomain 的名称解析超时。
百度:
部分转自:/diannaojichu/381132.html
这是由于windows的一个叫做network connectivity status indicator (ncsi)的服务导致的:每当用户连接到网络时,windows 7会向微软的一个域名发送访问请求,再通过访问/ncsi.txt获得结果作为网络连接状况指示器,你能够看到“网络受限”的警告就是由这个服务产生的。
访问这个网址:
在这个过程中微软的dns服务器可以记录来自windows 7客户机的一些基本信息,接受访问的所在的服务器也可以获得不少客户端的信息,数量庞大的情况下也可以作为侧面一种统计的依据。作为一个“有系统洁癖”的人果断是需要将此服务器关闭的。
一开始在服务中一直都没有找到这个叫做network connectivity status indicator (ncsi)服务,结果发现这家伙是直接写在注册表的服务项里的(hkey_local_machine\system\currentcontrolset\services\nlasvc),并没有显式表现出来,这让人不得不怀疑这服务是否本意就含有收集客户端信息来进行统计。需要关闭修改注册表键值hkey_local_machine\system\currentcontrolset\services\nlasvc\parameters\internet\下的enableacetiveprobing值为0。
大家可以手动编辑,或者我在这里写了一个对应的脚本,右键管理员运行:
disable_ncsi_service.bat
@echo off
chcp 65001 >nul
cd /d %~dp0
title ncsi state change
setlocal enabledelayedexpansion
set ncsi_reg=hklm\system\currentcontrolset\services\nlasvc\parameters\internet
echo ncsi state change
echo ====================================
echo author:feiquan
echo create:/2/28 23:10
echo updatadate:/2/28 23:40
echo version:1.0v
echo function:
echo change ncsi reg path %ncsi_reg%
echo change ncsi reg value 0 or 1
echo =====================================
echo.
echo current ncsi service state:
for /f "skip=2 usebackq tokens=3" %%i in (`reg query %ncsi_reg% /v enableactiveprobing`) do set /a a=%%i & if !a!==1 ( echo enable & set data=0 ) else ( echo disable & set data=1)
echo.
set question=y
set /p question=do you want to change ncsi state ? (y/n)
if /i not "%question%"=="y" exit
echo start to change ncsi state:
reg add "%ncsi_reg%" /v enableactiveprobing /t reg_dword /d !data! /f
for /f "skip=2 usebackq tokens=3" %%i in (`reg query %ncsi_reg% /v enableactiveprobing`) do set /a a=%%i & if !a!==1 ( echo enable ) else ( echo disable )
timeout /t 3
exit
运行结果:
脚本下载:
链接:/s/1-tmjk56k4x2ypardt0rhcg
提取码:ra8r