#201148 - 2010-12-14 09:35 AM
Urgent request - key lookup
|
sparkie
Getting the hang of it
Registered: 2010-09-14
Posts: 92
Loc: UK
|
I need to create a registry lookup of a key to somehow contact ICT if it exists. I currently use this command to lookup for another item.
IF ReadValue
Is this possible?
Many thanks
|
Top
|
|
|
|
#201149 - 2010-12-14 09:59 AM
Re: Urgent request - key lookup
[Re: sparkie]
|
sparkie
Getting the hang of it
Registered: 2010-09-14
Posts: 92
Loc: UK
|
Digging further maybe I can use the sendmessage to identify the user sending the message
|
Top
|
|
|
|
#201150 - 2010-12-14 11:30 AM
Re: Urgent request - key lookup
[Re: sparkie]
|
sparkie
Getting the hang of it
Registered: 2010-09-14
Posts: 92
Loc: UK
|
Ok, I'm getting nowhere fast with this. Using this context but it seems the lookup is not working. If I omit the KeyExist the messge gets submitted locally.
IF KeyExist ("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook”) $RC = SendMessage("ELWY", "Test") ELSE ?"do nothing" ENDIF
|
Top
|
|
|
|
#201152 - 2010-12-14 04:06 PM
Re: Urgent request - key lookup
[Re: Richard H.]
|
sparkie
Getting the hang of it
Registered: 2010-09-14
Posts: 92
Loc: UK
|
Thanks Richard, I had a play around and reverted to this but I have a couple of issues.
;$ReturnCode = KeyExist("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Default Outlook Profile") $ReturnCode = KeyExist("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook") If $ReturnCode SHELL "sc config messenger start= demand" SHELL "NET START Messenger" SHELL "sc config messenger start= disabled" $RC = SendMessage("MATAURA", "Test") ELSE ?"Do nothing"
Endif
It seems to work (sending test message to itself at the moment) but since my PC is Vista, it doesn't have the messenger service so it's becoming difficult to test.
Any ideas?
|
Top
|
|
|
|
#201155 - 2010-12-14 06:06 PM
Re: Urgent request - key lookup
[Re: Glenn Barnas]
|
sparkie
Getting the hang of it
Registered: 2010-09-14
Posts: 92
Loc: UK
|
I had a quick play with Blat and it didn't work. All I want to do is send a message to either a computer or an email address (internal domain) when a domain user logs in on a PC and a certain key exists.
I'm open to suggestions
|
Top
|
|
|
|
#201157 - 2010-12-14 06:57 PM
Re: Urgent request - key lookup
[Re: sparkie]
|
Glenn Barnas
KiX Supporter
Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
|
To send email, you need Blat or an equivelent application.
To send a message, you need the messaging service running (security risk) or need to write your own (complex).
Taking the time to properly configure Blat on a central server will be worth the 30 minutes of effort to install and configure it. Once done, any script can easily send a message via email.
Some things to consider with email - Blat needs to know the proper SMTP server address and may require a valid user account to send mail. The server sending mail via Blat may need to be configured on the mail server as an authorized relay host. This is just part of configuring email within your network.
Another solution, also in the Script Vault, would be to drop message files in the share of a central server. A script running there would process the dropped files, either sending email (again, with blat or similar tool), printing a report, or displaying a popup message. This way, all of the complex configuration is done on one computer.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
Top
|
|
|
|
#201171 - 2010-12-15 05:46 PM
Re: Urgent request - key lookup
[Re: Glenn Barnas]
|
sparkie
Getting the hang of it
Registered: 2010-09-14
Posts: 92
Loc: UK
|
No I haven't installed Blat. I downloaded the files and thought maybe I could copy the files to a folder and the script above could then be edited with the relevant credentials to run the .exe file. I'm thinking this is not the case.
I just want a simple way of reporting if a key exists when a user logs in based upon a current user key and since Messenger is disabled on everyones computer, it sounds like this is a problem.
Is there an alternative to a message?
|
Top
|
|
|
|
#201176 - 2010-12-16 10:00 AM
Re: Urgent request - key lookup
[Re: Glenn Barnas]
|
sparkie
Getting the hang of it
Registered: 2010-09-14
Posts: 92
Loc: UK
|
Ok, Blat seems to be working when I login to our Terminal Servers (2008) as a domain user, but not when I login to an XP domain PC.
One thing I need to do is have the email encorporate some kind of info to advise us which user/computer the email was sent from.
Edited by sparkie (2010-12-16 10:08 AM)
|
Top
|
|
|
|
#201178 - 2010-12-16 10:10 AM
Re: Urgent request - key lookup
[Re: Richard H.]
|
sparkie
Getting the hang of it
Registered: 2010-09-14
Posts: 92
Loc: UK
|
Richard,
That's exectly the one I'm running. Also I need to define who the email was coming from
|
Top
|
|
|
|
#201179 - 2010-12-16 11:48 AM
Re: Urgent request - key lookup
[Re: sparkie]
|
sparkie
Getting the hang of it
Registered: 2010-09-14
Posts: 92
Loc: UK
|
I'm going to scrap this idea since the workstations are locked down and too much time is being spent firefighting a simple email solution. Blat works using an out of box scenario, but not if ports/ etc aren't available.
|
Top
|
|
|
|
#201181 - 2010-12-16 12:20 PM
Re: Urgent request - key lookup
[Re: BradV]
|
sparkie
Getting the hang of it
Registered: 2010-09-14
Posts: 92
Loc: UK
|
Have the script write an INI file on a central server. Use the workstation name as the file name. Then write parameters as needed. Such as "user=fred", etc.
Then you can have a server process enumerate the directory; read the files it finds; send the e-mail; delete the file.
That seems to be my best solution, are there any examples here so I'm not re-inventing the wheel.
I'll need to to only run if domain user login OS is XP or Vista
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 128 anonymous users online.
|
|
|