Is there a way to script mmc actions? I've written a little hta that takes a
user ID as input, then queries our SMS database, retrieves all of the
computers that user has logged into recently, then creates buttons that
allow me to start a remote control session and/or display that computer's
latest inventory report. I'd like to add another function that starts up an
mmc with the computer management snapin set to the remote computer, so I can
easily look at things like event logs and group memberships for that
computer. So, basically, I want to use vbscript to launch the mmc with the
computer management snapin and pass it the remote computer name in a
variable. Thoughts?
Thanks,
Mike
here is an excample.
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "mmc"
WScript.Sleep 1000
WshShell.AppActivate "Console1"
WScript.Sleep 1000
WshShell.SendKeys "%f"
WScript.Sleep 50
WshShell.SendKeys "m"
WScript.Sleep 400
WshShell.SendKeys "{TAB}{TAB}{TAB}{ENTER}"
wscript.sleep 400
WshShell.SendKeys "{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{TAB}{enter}"
wscript.sleep 50
WshShell.SendKeys "{TAB}{ENTER}"
wscript.sleep 50
WshShell.SendKeys "{TAB}{ENTER}"
wscript.sleep 50
WshShell.SendKeys "{TAB}{ENTER}"
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Yes, there is a way to script MMC. This will get you started:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mmc/mmc/using_vbscript_with_the_mmc_2_0_automation_object_model.asp
Regards,
Peter Lundin
Sub Manage(strPC)
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
cmdline = "cmd.exe /c compmgmt.msc /computer=" & strPC
Set oExec = WshShell.Exec(cmdline)
End Sub
"Peter Lundin" <Peter...@discussions.microsoft.com> wrote in message
news:51C1D56C-4004-4124...@microsoft.com...