Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Sat Apr 20, 2024 10:53 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 
Author Message
 Post subject: Offer Remote Assistance
PostPosted: Thu Aug 02, 2007 6:28 am 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
If you have enabled "Unsolicited Remote Assistance" at your organization using group policy, you can add "Offer Remote Assistance" to the "Remote Management" interface. Since I don't use VNC, I replaced it with an Offer Remote Assistance link.

In system_viewdef_summary.php, replace the VNC section with this:

[code] "30"=>array("name"=>"RA",
"head"=>__("RA"),
"get"=>array("head"=>"Offer-Remote-Assistance",
"file"=>"launch.php",
"title"=>__("Offer-Remote-Assistance"),
"image"=>"./images/o_load_balancer.png",
"image_width"=>"16",
"image_height"=>"16",
"var"=>array("hostname"=>"%system_name",
"domain"=>"%net_domain",
"application"=>"Offer-Remote-Assistance",
"ext"=>"vbs",
),
),
),[/code]

Then in your doc_root folder add a file called "launch_filedef_Offer-Remote-Assistance.txt" with the following contents:

[code]set shell = createobject("wscript.shell")
dim strComputerName
strComputerName = "NAME"
Set oEx = shell.Exec("%COMSPEC% /C ver")
Do While oEx.Status=0
WScript.Sleep 100
Loop
While Len(os)<1
os=Replace(oEx.StdOut.ReadLine,vbCrLf,"")
Wend
If INSTR(ucase(os),"XP") Then
shell.run "hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/Unsolicited/Unsolicitedrcui.htm"
shell.AppActivate("Help and Support Center")
wscript.sleep 3000
shell.SendKeys strComputerName
WScript.Sleep 500
shell.SendKeys "{TAB}{ENTER}"
Else
cmdline = "msra.exe /offerRA NAME"
Shell.Run cmdline
End IF
[/code]

This works with both Vista and Windows XP.

Information on how to enable "Unsolicited Remote Assistance" is available at http://support.microsoft.com/kb/308013.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 02, 2007 5:57 pm 
Offline
Open-AudIT Fellow

Joined: Thu May 17, 2007 5:47 pm
Posts: 568
Location: Italy
Great job jpmorgan! I use both VNC and RA so I modified the first line to

"110"=>array("name"=>"RA",

to have both links and it works fine.
Could please someone add this feature to SVN?


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 02, 2007 8:53 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
Great idea. :D Haven't had time to test, but I will leave that to you guys. :twisted:

Added just under the RDP link, in SVN at ver 753. I also modded the default.css can someone try it with IE7

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 03, 2007 4:44 pm 
Offline
Open-AudIT Fellow

Joined: Thu May 17, 2007 5:47 pm
Posts: 568
Location: Italy
RA works fine, thank you.
Also default.css seems OK with IE6, IE7 and Mozilla 2.0.0.6


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 05, 2007 2:43 am 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
Good. (But I still don't think much of ie7!)

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 19, 2007 6:57 am 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
I've fixed a few issues with the Remote Assistance. I had an intermittent issue where the system name didn't appear when offering assistance from XP. Offering from 2003 didn't work. I changed the code to use WMI to determine the OS to eliminate the black command prompt screen.

launch_filedef_Offer-Remote-Assistance.txt:

[code]set shell = createobject("wscript.shell")
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
For Each objItem in colItems
os=objItem.Caption
Next
If INSTR(ucase(os),"XP") OR INSTR(ucase(os),"2003") Then
shell.run "hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/Unsolicited/Unsolicitedrcui.htm"
do while(shell.AppActivate("Help and Support Center")=FALSE)
wscript.sleep 1000
loop
wscript.sleep 2000
shell.SendKeys "NAME"
WScript.Sleep 500
shell.SendKeys "{TAB}{ENTER}"
ElseIf INSTR(ucase(os),"VISTA") Then
cmdline = "msra.exe /offerRA NAME"
Shell.Run cmdline
End IF
[/code]


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 20, 2007 6:26 pm 
Offline
Open-AudIT Fellow

Joined: Thu May 17, 2007 5:47 pm
Posts: 568
Location: Italy
Hi jpmorgan,
trying your last launch_filedef_Offer-Remote-Assistance.txt, now RA opens with 2003 also, but system name never appears, neither in xp, nor in w2k3.


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 20, 2007 10:33 pm 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
It worked fine for me on 2003,XP and Vista. I think there may be some timing issues. Can you try changing the two wscript.sleep lines?:

[code] do while(shell.AppActivate("Help and Support Center")=FALSE)
wscript.sleep 100
loop
wscript.sleep 3000
[/code]

If that doesn't work try this:

[code]
shell.AppActivate("Help and Support Center")
do while(shell.AppActivate("Help and Support Center")=FALSE)
wscript.sleep 100
loop
wscript.sleep 3000
[/code]


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 21, 2007 8:30 pm 
Offline
Open-AudIT Fellow

Joined: Thu May 17, 2007 5:47 pm
Posts: 568
Location: Italy
Even trying your suggestions, it seems that the "do-while" loop never exits: shell.AppActivate("Help and Support Center") is always false, so shell.SendKeys "NAME" is never executed. The reason seems that my OS isn't an english one, if I change "Help and Support Center" in my language, it seems to work fine. I tried using "HelpCtr.exe" instead, but it doesn't work.
But, is the "shell.AppActivate("Help and Support Center")" command really essential? I removed it and it works! Following is the "if" section of your code which is working for me on xp and 2k3:
[code]
If INSTR(ucase(os),"XP") OR INSTR(ucase(os),"2003") Then
shell.run "hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/Unsolicited/Unsolicitedrcui.htm"
wscript.sleep 3000
shell.SendKeys "NAME"
WScript.Sleep 500
shell.SendKeys "{TAB}{ENTER}"
ElseIf INSTR(ucase(os),"VISTA") Then
cmdline = "msra.exe /offerRA NAME"
Shell.Run cmdline
End IF
[/code]
The only strange thing (which was present with the previous version also) is that you have to launch the vbs 2 times to get the computer name to appear...
Thanks for your support.


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 22, 2007 1:13 am 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
I've tried to get rid of language specific references. Try this. Does it reliably populate the name field for each OS tested?

[code]set shell = createobject("wscript.shell")
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
WinDir = Shell.ExpandEnvironmentStrings("%WinDir%")
For Each objItem in colItems
os=objItem.Caption
Next
If INSTR(ucase(os),"XP") OR INSTR(ucase(os),"2003") Then
Set oRA = Shell.exec(WinDir & "\PCHEALTH\HELPCTR\Binaries\HelpCtr.exe -FromHCP -url hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/Unsolicited/Unsolicitedrcui.htm")
do while(shell.AppActivate(oRA.ProcessID)=FALSE)
wscript.sleep 2000
loop
wscript.sleep 1000
shell.SendKeys "NAME"
WScript.Sleep 500
shell.SendKeys "{TAB}{ENTER}"
ElseIf INSTR(ucase(os),"VISTA") Then
cmdline = "msra.exe /offerRA NAME"
Shell.Run cmdline
End IF
[/code]


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 22, 2007 4:50 pm 
Offline
Open-AudIT Fellow

Joined: Thu May 17, 2007 5:47 pm
Posts: 568
Location: Italy
Great! Now it seems to work fine on both XP and W2k3. Thank you!
Could please devs update SVN with this?


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 22, 2007 6:49 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
Added at SVN ver 777 :D

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 22, 2007 8:32 pm 
Offline
Open-AudIT Fellow

Joined: Thu May 17, 2007 5:47 pm
Posts: 568
Location: Italy
Thank you, Andrew


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group