As promised, here are the sample WMIC commands I demonstrated in the Automating Windows Server 2003 session yesterday evening in Reading. Hope they are useful to you.
Update static IP addresswmic nicconfig where index=9 call enablestatic("192.168.16.4"), ("255.255.255.0")Change network gatewaywmic nicconfig where index=9 call setgateways("192.168.16.4", "192.168.16.5"),(1,2)Enable DHCPwmic nicconfig where index=9 call enabledhcpService Managementwmic service where caption="DHCP Client" call changestartmode "Disabled"Start an applicationwmic process call create "calc.exe"Terminate an applicationwmic process where name="calc.exe" call terminateChange process prioritywmic process where name="explorer.exe" call setpriority 64Get list of process identifierswmic process where (Name='svchost.exe') get name,processidInformation about harddriveswmic logicaldisk where drivetype=3 get name, freespace, systemname, filesystem, size, volumeserialnumberInformation about oswmic os get bootdevice, buildnumber, caption, freespaceinpagingfiles, installdate, name, systemdrive, windowsdirectory /format:htable > c:\osinfo.htmInformation about fileswmic path cim_datafile where "Path='\\windows\\system32\\wbem\\' and FileSize>1784088" > c:\wbemfiles.txtProcess listwmic process get /format:htable > c:\process.htmRetrieve list of warning and error events not from system or security logsWMIC NTEVENT WHERE "EventType<3 AND LogFile != 'System' AND LogFile != 'Security'" GET LogFile, SourceName, EventType, Message, TimeGenerated /FORMAT:"htable.xsl":" datatype = number":" sortby = EventType" > c:\appevent.htm
Can you run the ** wmic process call create "application" ** remotely to a client desktop?
I.E - Launch MSWord on a client PC from a helpdesk PC.
Have a look at the /node (in help and support) parameter which should permit this. However, I've pretty much broken my test environment and can't confirm this currently. Also, have a look at the bottom of this article http://www.serverwatch.com/tutorials/article.php/1476821.
Hope this helps
Thanks for the samples, I found last nights technet evening to be very useful. Do you have the example scripts that you ran earlier in the eving to obtain the information about the setup of the server.
Glad you enjoyed the session. This is the script I ran to gather a variety of system information from server3 remotely...
systeminfo /s \\server3 > c:\GatherInfo.txt
driverquery /s \\server3 >> c:\GatherInfo.txt
getmac /S \\server3 >> c:\GatherInfo.txt
freedisk /s \\server3 /D C: >> c:\GatherInfo.txt
gpresult /s \\server3 >> c:\GatherInfo.txt
sc \\server3 query >> c:\GatherInfo.txt
eventquery /S \\server3 /L application /FI "type eq error" >> c:\GatherInfo.txt
I’m a little behind on my regularly scheduled blog posting, I’ll try to keep up with posting every couple
You know sometimes when you come across something that's been around for ages and yet you've never heard of it. Some little gem of information or utility that seems so small yet perfectly formed ...