Hi All,
I read this question many times and I have also posted an answer in the WMI
newsgroup a long time ago.
Just to bring my point:An admin has really MANY needs to display messages on
remote computers [in mayn times, on all of them at the same time] and there
is noting like this in Windows and the messenger service is often disabled
but also is not the right tool, because it cannot provide enough text and
the user simply clicks it away. Admin usually avoid sending popups, but
there are a lot of situations, were ir cannot be avoided.
Remote processes, with WMI on pure WSH based, do not have the necessary
rights to interact with the current users desktop. You must run as a service
application as local service and enable "interact with desktop". Most admin
are not able to create their own services, but the .Net runtime makes this
easy.
The scheduler service would alo work, because one can create a task and then
just run it. But there is no scriptable interface to do that and that was
completely overseen by WMI :-(
Users of the Siteserver Resource Kit have a scriptable scheduler service
interface, but this is not publicly available.
Mostly overseen, COM is your best friend!!! A COM component can be running
under the "interactive user" and this helps solving the problem. Such a
component may also easily be written in script, known as a script component
and stored in a file of type ".wsc". Write a simple component like I try to
demonstrate it here in a very short [and untested example], look for it at
the end. If this component has a method "ShowUrl(url)" you can write another
script, which uses this component like usual, for example:
Option Explicit
Set objTool = CreateObject("MBG.Tools-IE3")
objTool.ShowUrl "
http://www.google.com" 'OK, dont do it like
this, --spam ;-)
WScript.Quit(0)
This script can be executed locally, no problem, but also remotely, if ithe
component is registered with the COM+ catalog, see later. I prefer WMI to
run scripts on remote machines, because I can set credentials. If the shown
script will be executed via WMI it would runs on the executing users [the
remote users] desktop and a message-box and something like this is displayed
on this hidden desktop. But the moment, the script instantiates the show
"MBG.Tools-IE3" helper object, this runs in the desktop of the interactive
user and is really visible. I use such a component to display one of it's
two "build-in" dialogs, one for short notifications and one as a
setup-progress dialog. The sample above could be enough to popup Internet
Explorer and direct it to the admin message provided by an intranet page.
On the other hand, this component must be present on each computer, on which
such a notification has to be displayed. This is not too complicated. Write
the component and test it properly. Go to the COM+ catalog and create a new
empty COM+ server application. Configure it to run as the interactive user.
Then, in that application import your script component. After it is
importet, test it again. This component MUST be registered in COM+ to be
usable in the show way. COM+ also provides more help:Go to the COM+ console
again and export the application. This generates a MSI file, which is very
good for installations. Then use one of the better known WMI script to
install this msi file on all your computers remotely, no walking ;-)
This is not very dangerous from the virus-danger perspective, a virus will
usually not know your COM interface becasue it is not public [hopefully]. I
have otherwise not addressed security here.
Hope, this helps. If there are more questions, I hope, I can answer them.
Best regards,
Manfred Braun
(Private)
Mannheim
Germany
mailto:
[email protected]
(Remove the anti-spam-underscore to mail me!)
web
http://www.manfbraun.de
Sample component
<?xml version="1.0"?>
<component>
<registration
description="MBG.Tools-IE3, MBG tools for IE."
progid="MBG.Tools.IE3"
version="0.0"
classid="{814C0D17-32A5-11D5-9274-008048849629}"</registration>
<public>
<method name="ShowUrl"/>
</public>
<script language="VBScript">
<![CDATA[
Option Explicit
Sub ShowUrl(ByVal url)
Set objIE = CreateObject("InternetExplorer.Application") 'Create IE
object.
objIE.top = 40
objIE.left = 40
objIE.width = 200
objIE.height = 400
objIE.resizable = False
objIE.ToolBar = False
objIE.MenuBar = False
objIE.AddressBar = False
objIE.Visible = True
objIE.Navigate2 url
End Sub
]]>
</script>
</component>