#211246 - 2016-03-29 11:03 PM
Inputbox is appearing minimized
|
ardy8888
Fresh Scripter
Registered: 2016-03-28
Posts: 9
Loc: New York
|
I've got kixtart working to open an inputbox to request the user to enter some info. However, the inputbox is appearing minimized, right next to the minimized kixtart application window. Any idea why the inputbox is minimized and how I can have it not minimized by default.
|
Top
|
|
|
|
#211248 - 2016-03-30 02:19 PM
Re: Inputbox is appearing minimized
[Re: Glenn Barnas]
|
ardy8888
Fresh Scripter
Registered: 2016-03-28
Posts: 9
Loc: New York
|
I honestly don't know if this is Kixforms. Here is the code I am running. Basically, checks for group membership. If the user is in the group, an inputbox is supposed to pop up asking for their email address and then the script sends an email to that address. Everything works except that the inputbox shows up minimized. if ingroup ("adsstest")
SHELL 'cscript //nologo \\domain.local\netlogon\ADSelfService_Enroll_Check.vbs'
if @ERROR = 47
$smtpto=inputbox("Enter your email address for more info on Enrollment.","Enrollment")
MAILER($smtpto)
endif
endif
Edited by Glenn Barnas (2016-03-30 03:29 PM) Edit Reason: added code tags
|
Top
|
|
|
|
#211249 - 2016-03-30 03:21 PM
Re: Inputbox is appearing minimized
[Re: ardy8888]
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4542
Loc: USA
|
|
Top
|
|
|
|
#211251 - 2016-03-30 03:51 PM
Re: Inputbox is appearing minimized
[Re: BradV]
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4395
Loc: New Jersey
|
Brad - MessageBox is output only (OK, mostly - it allows button-based input). This needs to prompt for manual input text - email address. Also - he is using Kix for membership identification (If InGroup). I do agree that we can probably replace the VBS, but suspect its a 3rd party component of the AD Self Service app.
I looked at that function and don't see any controls for presence (minimize, show/hide, etc.) I did a quick look at this but could not find any more information about control options. I'd suggest not minimizing the Kix script and see if that helps.
KixForms would certainly help here, but that would require deploying/registering the DLL. Not as big an issue as you might suspect. I've used a BAT file to copy Kixforms.dll to C:\TEMP, register it with RegSvr32, then invoked the Kix/KF app, and then unregistered/delete the DLL. Hardly took any time at all. User permissions could be an issue with this, however, as users rarely have the needed rights nowadays.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
Top
|
|
|
|
#211252 - 2016-03-30 04:03 PM
Re: Inputbox is appearing minimized
[Re: BradV]
|
ardy8888
Fresh Scripter
Registered: 2016-03-28
Posts: 9
Loc: New York
|
Hey Brad, thanks for the response here!
Can the messagebox function take input?? I assumed it was just to post a message which is why I went with inputbox. The vbs script makes an http post to query if someone has enrolled into a selfservice portal (ManageEngine's ADSelfServicePlus). The post is made to the selfservice application directly and it returns true or false. Below is the vbs code. I've copied this section from a script provided by ManageEngine as their script did some other tasks I didn't need. I could probably simplify the script a bit as it is querying for the domain name but that is the same for everyone so I could specifically state that in the http post
On Error Resume Next
Set objNetwork = CreateObject("WScript.Network")
url = "https://localhost:443" + "/CheckEnrollment.cc"
postData = "user=" + objNetwork.UserName + "&domainFlatName=domain" + "&domainDNSName=domain.local" + "&manualScript=true"
Set oHTTP = CreateObject("MSXML2.ServerXMLHTTP")
oHTTP.open "POST", url,false
oHTTP.setOption 2, 13056
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oHTTP.setRequestHeader "Content-Length", Len(postData)
oHTTP.send postData
response = oHTTP.responseText
result = 0
If InStr(response, "Non-Enrolled User") Then
result = 12
ElseIf InStr(response, "Enrolled User") Then
result = 47
End If
wscript.quit result
Edited by Mart (2016-03-30 04:48 PM) Edit Reason: Added code tags.
|
Top
|
|
|
|
#211253 - 2016-03-30 04:12 PM
Re: Inputbox is appearing minimized
[Re: ardy8888]
|
ardy8888
Fresh Scripter
Registered: 2016-03-28
Posts: 9
Loc: New York
|
Thanks for the all the responses here. When I run kix32 manually which doesn't minimize, the inputbox is not minimized. It only seems to be minimized at logon, when kixtart is minimized.
|
Top
|
|
|
|
#211255 - 2016-03-30 05:03 PM
Re: Inputbox is appearing minimized
[Re: Glenn Barnas]
|
ardy8888
Fresh Scripter
Registered: 2016-03-28
Posts: 9
Loc: New York
|
Thanks Glenn, will this SetConsole() function make the entire kixtart script visible or can I set this just for the inputbox? Just trying to understand where SetConsole() should be in the file.
|
Top
|
|
|
|
#211256 - 2016-03-30 05:55 PM
Re: Inputbox is appearing minimized
[Re: ardy8888]
|
ardy8888
Fresh Scripter
Registered: 2016-03-28
Posts: 9
Loc: New York
|
Awesome! I just played with SetConsole and if I select HIDE, the kix32 script window is hidden but the inputbox does appear, not minimized or hidden!!
Thanks for everyone's input here!
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 452 anonymous users online.
|
|
|