JohnTodd
(Fresh Scripter)
2007-06-12 12:12 AM
Display an HTML page at login?

Sorry guys... I looked all over, but I can't figure this one out. I'm sure it's simple, but I have an advanced case of brainlock today.

I just need to open and display a web page (our AUP) upon login.

How is it done?

Thanks in advance.


NTDOCAdministrator
(KiX Master)
2007-06-12 12:33 AM
Re: Display an HTML page at login?

shell / run iexplorer.exe to the page, or if association is valid then just the URL of the page location should do it.

If you need further assistance let us know.


JohnTodd
(Fresh Scripter)
2007-06-12 01:04 AM
Re: Display an HTML page at login?

I was right... I should have known.

Update; I tried both SHELL and RUN and both aren't working for me. If I go to the Windows command line, I pass the url and it works like a champ.

Any help?


NTDOCAdministrator
(KiX Master)
2007-06-12 02:20 AM
Re: Display an HTML page at login?

Okay give something like this a try.

 Code:
Dim $Site, $IExplore
$Site = 'http://www.yahoo.com/'
$IExplore = ReadValue('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE','')
RUN $IExplore + ' ' + $Site


Radimus
(KiX Supporter)
2007-06-12 03:40 AM
Re: Display an HTML page at login?

run 'cmd /c start http://www.kixtart.org'

(or shell)


NTDOCAdministrator
(KiX Master)
2007-06-12 11:53 AM
Re: Display an HTML page at login?

That should work unless path or association is screwed up. It would also launch the default browser instead of a given one if you wanted a specific one to launch.

Radimus
(KiX Supporter)
2007-06-12 12:17 PM
Re: Display an HTML page at login?

and if the machines browser assoc is screwed up, the PC needs to be fixed.

depts that run multiple browsers deserve to be shot


Glenn BarnasAdministrator
(KiX Supporter)
2007-06-12 05:26 PM
Re: Display an HTML page at login? - WARNING!

 Originally Posted By: NTDOC
shell / run iexplorer.exe to the page, or if association is valid then just the URL of the page location should do it.

If you need further assistance let us know.


CAUTION!! Launch IE as "iexplore.exe"! Tacking on the extra "r" at the end is not correct, and in fact is how certain viruses are triggered (and hide in plain (pain?) sight this way.) Google "Spy Sherrif" for more info on one example, but use extreme caution accessing the sites.

Glenn


JohnTodd
(Fresh Scripter)
2007-06-12 06:17 PM
Re: Display an HTML page at login?

 Originally Posted By: NTDOC
Okay give something like this a try.

 Code:
Dim $Site, $IExplore
$Site = 'http://www.yahoo.com/'
$IExplore = ReadValue('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE','')
RUN $IExplore + ' ' + $Site



This worked perfectly, and it even taught me a couple of things. Thanks very much!


eriqjaffe
(Hey THIS is FUN)
2007-06-12 07:17 PM
Re: Display an HTML page at login?

 Originally Posted By: Radimus
depts that run multiple browsers deserve to be shot
 Code:
if keyexist("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE") and keyexist("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe")
   ShootDept()
endif

Now somebody just needs to write the UDF. ;\)


JohnTodd
(Fresh Scripter)
2007-06-15 01:04 AM
Re: Display an HTML page at login?

Thanks for all the help, but I'm still in a pickle.

If I run the script manually by dragging the script to wkix32.exe, NTDOC's script runs just fine. When the script is called from the GPO, my mappings work, my printer distribution works... But the call to the browser doesn't run.

Any ideas?


Here's my script, in case someone wants to critique... pretty basic.

 Code:
SetTime "\\dc1"

CLS
Break off


;---------------------------------------------------------------
;Delete Network Mappings
;---------------------------------------------------------------

Use "*" /delete /PERSISTENT

;---------------------------------------------------------------
;Map Global Network Drives
;---------------------------------------------------------------

? "Mapping Drives"
Use H: "\\nasbox\vol2"
Use I: "\\saturn\vol3"
Use J: "\\nasbox\vol4"
Use K: "\\nasbox\vol5"
Use L: "\\saturn\vol6"
Use N: "\\saturn\vol11"
Use O: "\\saturn\vol8"
Use P: "\\saturn\vol6\PDOXDATA"
Use Q: "\\minerva\AutoCadE"
Use R: "\\nasbox\snap"
Use S: "\\dc1\netlogon"
Use U: "\\nasbox\production"
Use V: "\\Juno\D"
Use Y: "\\nasbox\Network"
Use X: "\\nasbox\users\@userid"
Use Z: "\\minerva\vol1\apps\acad"

;---------------------------------------------------------------
;Map Printers
;---------------------------------------------------------------

	? "Deleting Printers"

	delprinterconnections()

	? "Adding Printers"
  	If AddPrinterConnection ("\\ps\HP1220C") = 0
	? "Added HP 1220C Color Inkjet Printer Connection"
	'Error: ' + @ERROR + ' - ' + @SERROR ?
	EndIf
	If AddPrinterConnection ("\\ps\hp5000") = 0
	? "Added HP5000 Laserjet Printer Connection"
	'Error: ' + @ERROR + ' - ' + @SERROR ?
	EndIf
	If AddPrinterConnection ("\\ps\p7400") = 0
	? "Added Xerox Phaser 7400 Color Laser Printer Connection"
	'Error: ' + @ERROR + ' - ' + @SERROR ?
	EndIf

;---------------------------------------------------------------
;Display AUP
;---------------------------------------------------------------

Dim $Site, $IExplore
$Site = '\\saturn\vol11\aup\motd.htm'
$IExplore = ReadValue('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE','') 
RUN $IExplore + ' ' + $Site

;---------------------------------------------------------------
;Run TrackIt audit
;---------------------------------------------------------------

run 'N:\TrackIt\audit32.exe'

;---------------------------------------------------------------

function DelPrinterConnections()
dim $c,$bk,$conn
$c=0
$bk="HKEY_CURRENT_USER\Printers\Connections"
$conn=enumkey($bk,$c)
while @error=0
$c=$c+0.5
$conn=delkey($bk+"\"+$conn)
$conn=enumkey($bk,$c)
loop
endfunction



Sealeopard
(KiX Master)
2007-06-16 03:08 PM
Re: Display an HTML page at login?

Don't use SETTIME. SETTIME reuqires elevated prvileges likepower user of the set time privileges, secondly, the proper AD setup would use a time server topography utilizing W32TM services. SETTIME should only be used for Wintendos support.

Saleem
(Hey THIS is FUN)
2007-06-18 11:16 AM
Re: Display an HTML page at login?

I was looking for similer issue and found this post

One doubt

Can we make a control over that AUP HTML page and parse the result to acript... some thing like "I Accept" or "I dont" ??

If the user press I dont then script logs them off and record there details.... If they accept log there detailes and script continues...??

is it possible to make some control with those goodies ??


Gargoyle
(MM club member)
2007-06-18 05:42 PM
Re: Display an HTML page at login?

Kixforms may be the way you want to go -

http://www.kixforms.org


BillBarnard
(Starting to like KiXtart)
2007-08-08 11:49 AM
Re: Display an HTML page at login?

Try this to display Notice.html at logon time for 30 secs. Notice.html is located in the netlogon folder of your domain controllers.

If not exist("@lserver\netlogon\Notice.html")
Return
Endif

Dim $oIE

$oIE = CreateObject("InternetExplorer.Application")

while $oIE.busy
loop

$oIE.Navigate("@lserver\netlogon\Notice.html")

$False = 0
$True = 1

$oIE.height = 400
$oIE.width = 600
$oIE.AddressBar = $False
$oIE.StatusBar = $False
$oIE.ToolBar = $False
$oIE.MenuBar = $False
$oIE.Visible = $True

; Wait for 30 seconds

sleep 30

$oIE.Quit

$oIE = Nothing

Return


Richard H.Administrator
(KiX Supporter)
2007-08-08 11:59 AM
Re: Display an HTML page at login?

I think you missed a vital point of the (hijacked) post:
 Quote:
Can we make a control over that AUP HTML page and parse the result to acript... some thing like "I Accept" or "I dont" ??


Though not impossible to do with IE it is tricky and you are at the mercy of MS introducing additional security into the APIs which have broken automation in the past.

It is much simpler to do with KiXforms, and the automation / APIs are under community control.


BillBarnard
(Starting to like KiXtart)
2007-08-08 12:12 PM
Re: Display an HTML page at login?

That quote wasn't commented on by the original poster of the topic.
I was just helping out with another way to do what was asked.
I didn't want to debate on IE security etc.
I use plain text in a Messagebox to inform my users of information at logon time.

Cheers,

Bill


NTDOCAdministrator
(KiX Master)
2007-08-15 12:04 PM
Re: Display an HTML page at login?

Hi John,

The type of policy you're running will affect if the user sees it or not.

Did you get this going or do you still need assistance.?


Arend_
(MM club member)
2007-08-15 12:09 PM
Re: Display an HTML page at login?

also this won't work
 Code:
$oIE = Nothing

Thats VB, in kix it would be
 Code:
$oIE = ""


NTDOCAdministrator
(KiX Master)
2007-08-15 12:30 PM
Re: Display an HTML page at login?

True. However KiX will cleanup after itself pretty good without it most of the time, but setting it to do so is probably a better practice

Nice catch there Apronk


Witto
(MM club member)
2007-08-15 02:34 PM
Re: Display an HTML page at login?

I have some problems understanding the modified DelPrinterConnections() in JohnTodd's code.
I strip a little part from the code:
 Code:
Dim $c
$c=0
$c=$c+0.5

$c is a long with value 0 because of $c=0
0.5 (double) is implicit casted to a long with value 0
After the addition ($c=$c+0.5) $c is still a long with value 0
IMHO he should:


Björn
(Korg Regular)
2007-08-15 02:42 PM
Re: Display an HTML page at login?

 Code:
Use X: "\\nasbox\users\@userid"
;should at least be
Use X: "\\nasbox\users\" + @userid