a. 启动Windows Management Instrumentation服务,开放TCP135端口。
b. 本地安全策略的“网络访问: 本地帐户的共享和安全模式”应设为“经典-本地用户以自己的身份验证”。
USERACCOUNT【账号管理】:
更改当前用户名
WMIC USERACCOUNT where "name='%UserName%'" call rename newUserName
WMIC USERACCOUNT create /?
SHARE【共享管理】:
建立共享
WMIC SHARE CALL Create "","test","3","TestShareName","","c:\test",0
(可使用 WMIC SHARE CALL Create /? 查看create后的参数类型)
删除共享
WMIC SHARE where name="C$" call delete
WMIC SHARE where path='c:\\test' delete
SERVICE【服务管理】:
更改telnet服务启动类型[Auto|Disabled|Manual]
wmic SERVICE where name="tlntsvr" set startmode="Auto"
运行telnet服务
wmic SERVICE where name="tlntsvr" call startservice
停止ICS服务
wmic SERVICE where name="ShardAccess" call stopservice
删除test服务
wmic SERVICE where name="test" call delete
FSDIR【目录管理】
列出c盘下名为test的目录
wmic FSDIR where "drive='c:' and filename='test'" list
删除c:\good文件夹
wmic fsdir "c:\\test" call delete
重命名c:\test文件夹为abc
wmic fsdir "c:\\test" rename "c:\abc"
wmic fsdir where (name='c:\\test') rename "c:\abc"
复制文件夹
wmic fsdir where name='d:\\test' call copy "c:\\test"
datafile【文件管理】
重命名
wmic datafile "c:\\test.txt" call rename c:\abc.txt
【任务计划】:
wmic job call create "notepad.exe",0,0,true,false,********154800.000000+480
wmic job call create "explorer.exe",0,0,1,0,********154600.000000+480