Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > VBScript and asp...

Reply
Thread Tools

VBScript and asp...

 
 
Leszek
Guest
Posts: n/a
 
      11-04-2004
Hello gurus!
I wrote a code in VBS, that will check, that current user is in one from
three groups.
But i don't know how asimilate it with asp.net.
This page will be a bridge between 2 - main menu and report page.
Tomorrow to the 8 a.m. i must do this, but i don't know how.... Can someone
help me?
There are few messageboxes for help.
Here is my code (it's vbs):

Sub Main
Dim objUserName, objUserDomain, oGroup, objUser, gList, WshShell, sMessage,

sTitle
Dim objDomain, vDomain, vUserName
Dim objChangePwdTrue, objChangePwd, objUserProfile
Dim objPwdExpiresTrue, objFlags
Dim objAcctDisabled, intPwdExpired, objPwdExpiredTrue
Dim admin, manag, audit
admin = false
manag = false
audit = false
Set WshShell = WshShell.CreateObject("WScript.Shell")
vdomain = WshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
vUserName = Request.ServerVariables("USERNAME")
'Request.ServerVariables("REMOTE_USER")

GetInfo ' sub routing to get user information
For Each oGroup In objUser.Groups
If gList = "" Then
gList = oGroup.Name
Else
gList = gList & ", " & oGroup.Name
End If
Next

for each oGroup in objUser.Groups
if oGroup.Name = "Administrators" Then
admin = true
msgbox(ogroup.Name)
Else
End if

if ogroup.name = "ManagReports" Then
manag = true
msgbox(ogroup.name)
Else
End if

if ogroup.name = "AuditReports" Then
audit = true
msgbox(ogroup.name)
Else
End if
Next
dim a
If admin = true then
set a = RSExecute("menugl.html")
'FRAME SRC="menugl.htmL" NAME="Podstawowa"
'<FRAMESET>'</FRAMESET>
End if

msgbox(admin & " " & manag & " " & audit)

if znaleziona then
else
End if
end sub
Sub GetInfo()
sMessage = "Please enter the domain to search." & vbCrLf & vbCrLf & _
"Default is: " & vDomain & vbCrLf & vbCrLf
sMessage = sMessage & "Hit Cancel or enter a blank to quit"
sTitle = "Domain to Search"

If vDomain = "" Then ' Cancelled by the user
' WScript.quit
End If

ssMessage = ""
ssTitle = ""

on error resume Next
sMessage = "Please enter the USER Login ID" & vbCrLf & vbCrLf & _
"Default is: " & vUserName & vbCrLf & vbCrLf
sMessage = sMessage & "Hit Cancel or enter a blank to quit"
sTitle = "USER Login ID"

If vUserName = "" Then ' Cancelled by the user
WScript.quit
End If

Set objUser = GetObject("WinNT://"& vDomain &"/"& vUserName & "",user)
If Err Then
msgNoUser = "Error: Could not bind to the following user: " &

vbCrLf _
& vbCrLf & "WinNT://" & vDomain &"/"& vUserName & vbCrLf &

vbCrLf _
& "Please verify your domain and user name and try again"
WshShell.Popup msgNoUser,0,"Error retrieving

information",vbCritical
GetInfo
Else
End If
End Sub

Function IsCScript()
If (InStr(UCase(WScript.FullName), "CSCRIPT") <> 0) Then
IsCScript = True
Else
IsCScript = False
End If
End Function



 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      11-04-2004
Leszek wrote on 04 nov 2004 in microsoft.public.inetserver.asp.general:

> I wrote a code in VBS, that will check, that current user is in one from
> three groups.
> But i don't know how asimilate it with asp.net.
>


This NG is classic ASP only.

For ASP.net please ask a dot.net NG.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      11-04-2004
Leszek wrote:
> Hello gurus!
> I wrote a code in VBS, that will check, that current user is in one
> from three groups.
> But i don't know how asimilate it with asp.net.


There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-savvy person here who can
answer your question, you can eliminate the luck factor by posting your
question to a newsgroup where the dotnet-savvy people hang out. I suggest
microsoft.public.dotnet.framework.aspnet.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
Leszek
Guest
Posts: n/a
 
      11-04-2004
There i can ask about asp.net.
I want to do this by normal asp with VBScript. This is newsgroup for asp
(and optional VBScript or Javascript?)
And i made a mistake - paste wrong code. This is for VB.NET.
My code in vbscript looks something like that:

Dim objUserName, objUserDomain, oGroup, objUser, gList, WshShell, sMessage,
sTitle
Dim objDomain, vDomain, vUserName
Dim objChangePwdTrue, objChangePwd, objUserProfile
Dim objPwdExpiresTrue, objFlags
Dim objAcctDisabled, intPwdExpired, objPwdExpiredTrue
Dim admin, manag, audit
admin = false
manag = false
audit = false
Set WshShell = WshShell.CreateObject("WScript.Shell")
vdomain = WshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
vUserName = Request.ServerVariables("USERNAME")
'Request.ServerVariables("REMOTE_USER")

GetInfo ' sub routing to get user information
For Each oGroup In objUser.Groups
If gList = "" Then
gList = oGroup.Name
Else
gList = gList & ", " & oGroup.Name
End If
Next

for each oGroup in objUser.Groups
if oGroup.Name = "Administrators" Then
admin = true
msgbox(ogroup.Name)
Else
End if

if ogroup.name = "ManagReports" Then
manag = true
msgbox(ogroup.name)
Else
End if

if ogroup.name = "AuditReports" Then
audit = true
msgbox(ogroup.name)
Else
End if
Next
dim a
If admin = true then
set a = RSExecute("menugl.html")
'FRAME SRC="menugl.htmL" NAME="Podstawowa"
'<FRAMESET>'</FRAMESET>
End if

msgbox(admin & " " & manag & " " & audit)

if znaleziona then
else
End if
end sub
Sub GetInfo()
sMessage = "Please enter the domain to search." & vbCrLf & vbCrLf & _
"Default is: " & vDomain & vbCrLf & vbCrLf
sMessage = sMessage & "Hit Cancel or enter a blank to quit"
sTitle = "Domain to Search"

If vDomain = "" Then ' Cancelled by the user
' WScript.quit
End If

ssMessage = ""
ssTitle = ""

on error resume Next
sMessage = "Please enter the USER Login ID" & vbCrLf & vbCrLf & _
"Default is: " & vUserName & vbCrLf & vbCrLf
sMessage = sMessage & "Hit Cancel or enter a blank to quit"
sTitle = "USER Login ID"

If vUserName = "" Then ' Cancelled by the user
WScript.quit
End If

Set objUser = GetObject("WinNT://"& vDomain &"/"& vUserName & "",user)
If Err Then
msgNoUser = "Error: Could not bind to the following user: " &

vbCrLf _
& vbCrLf & "WinNT://" & vDomain &"/"& vUserName & vbCrLf &

vbCrLf _
& "Please verify your domain and user name and try again"
WshShell.Popup msgNoUser,0,"Error retrieving

information",vbCritical
GetInfo
Else
End If

Function IsCScript()
If (InStr(UCase(WScript.FullName), "CSCRIPT") <> 0) Then
IsCScript = True
Else
IsCScript = False
End If
End Function





Użytkownik "Bob Barrows [MVP]" <(E-Mail Removed)> napisał w
wiadomości news:(E-Mail Removed)...
> Leszek wrote:
>> Hello gurus!
>> I wrote a code in VBS, that will check, that current user is in one
>> from three groups.
>> But i don't know how asimilate it with asp.net.

>
> There was no way for you to know it, but this is a classic asp newsgroup.
> While you may be lucky enough to find a dotnet-savvy person here who can
> answer your question, you can eliminate the luck factor by posting your
> question to a newsgroup where the dotnet-savvy people hang out. I suggest
> microsoft.public.dotnet.framework.aspnet.
>
> Bob Barrows
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      11-04-2004

Leszek wrote:
> There i can ask about asp.net.
> I want to do this by normal asp with VBScript.

Huh? I thought you said: "But i don't know how asimilate it with asp.net."

> asp (and optional VBScript or Javascript?)
> And i made a mistake - paste wrong code. This is for VB.NET.
> My code in vbscript looks something like that:
>

<snip>

Please ask a specific question.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      11-05-2004
Hi Leszek,

http://www.aspfaq.com/5003

Ray at work

"Leszek" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello gurus!
> I wrote a code in VBS, that will check, that current user is in one from
> three groups.
> But i don't know how asimilate it with asp.net.
> This page will be a bridge between 2 - main menu and report page.
> Tomorrow to the 8 a.m. i must do this, but i don't know how.... Can
> someone
> help me?
> There are few messageboxes for help.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mixing vbscript and ASP.NET Mario Rodriguez ASP .Net 2 12-17-2008 06:20 PM
Creating DNS Reverse Lookup zones, and PTR records using VBScript and WMI Rahul Apte ASP General 0 04-27-2004 11:43 AM
vbscript validations and .NET Jon Paugh ASP .Net 1 12-17-2003 07:17 PM
mixing Javascript and VBScript in ASP.NET? Jamie ASP .Net 1 12-05-2003 11:54 PM
ASP, vbscript and Netscape... sftwrdvlpr ASP .Net 0 06-25-2003 05:12 PM



Advertisments