VBScript and asp...

Discussion in 'ASP General' started by Leszek, Nov 4, 2004.

  1. Leszek

    Leszek Guest

    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
    Leszek, Nov 4, 2004
    #1
    1. Advertising

  2. Leszek

    Evertjan. Guest

    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)
    Evertjan., Nov 4, 2004
    #2
    1. Advertising

  3. 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.
    Bob Barrows [MVP], Nov 4, 2004
    #3
  4. Leszek

    Leszek Guest

    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]" <> napisa³ w
    wiadomo¶ci news:...
    > 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.
    >
    >
    Leszek, Nov 4, 2004
    #4
  5. 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.
    Bob Barrows [MVP], Nov 4, 2004
    #5
  6. Hi Leszek,

    http://www.aspfaq.com/5003

    Ray at work

    "Leszek" <> wrote in message
    news:...
    > 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.
    Ray Costanzo [MVP], Nov 5, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sftwrdvlpr

    ASP, vbscript and Netscape...

    sftwrdvlpr, Jun 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    887
    sftwrdvlpr
    Jun 25, 2003
  2. Gabriele Zannoni

    ASP + ASP.NET + VBScript + C#?

    Gabriele Zannoni, Sep 8, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    647
    Marina
    Sep 8, 2004
  3. Roja Doja
    Replies:
    2
    Views:
    3,257
    Roja Doja
    Apr 14, 2005
  4. Joe
    Replies:
    2
    Views:
    393
    Martin Honnen
    Apr 25, 2009
  5. John Davis

    ASP JavaScript versus ASP VBScript

    John Davis, Sep 6, 2003, in forum: ASP General
    Replies:
    5
    Views:
    132
    Curt_C [MVP]
    Sep 7, 2003
Loading...

Share This Page