Solved

Need to have a program that runs under Limited User but allows launching of Command prompt, etc. w/ Admin rights

Posted on 2006-11-23
6
273 Views
Last Modified: 2010-04-23
Here's our dilemma.  We have an extremely locked down environment on remote machines (no command prompt, control panel, etc).  Rather than having to logoff/on each time, we need quick access to the command prompt.

We want a program that will a launch, prompt for a "daily passcode" (IE today's date * 5, or whatever).  Then, you click a button and it launches the command prompt.  Since the command prompt is BLOCKED by Group Policy, it needs to launch CMD.EXE w/ RUN AS but shouldn't prompt for the user.

Something like this -- > http://launch-admin.sourceforge.net/

The difference is, that we want it to be custom tailoried to our environment so we can add our "daily passcode" protection.

I'm not a programmer, but we have one here in our office that would understand VB .NET if I had the code.  We can also do in VB6 if it's easy enough -- But that may not be the way to go.


Thanks!
0
Comment
Question by:jgantes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 16

Expert Comment

by:Hillwaaa
ID: 18001886
Hi jgantes,

if you put the following into a VB .NET project it will (when run) prompt you for the users's password then start cmd.exe.  There isn't a "/password" option for runas, so I don't think you can supply this easily.  If you still need the "daily passcode" as well as the user you could just craft a popup windows form that prompts for the passcode.  Let me know if you need a hand with this as well.

        Dim x As New System.Diagnostics.Process
        x.StartInfo.FileName = "runas.exe"
        x.StartInfo.Arguments = "/user:DomainName\AdministratorAccountName cmd.exe"
        x.Start()

Cheers,
Hillwaaa
0
 

Author Comment

by:jgantes
ID: 18004501
Hi Hilwaaa,

I'm thinking the daily passcode part should be prett straightforward.  I guess we're out of luck then on the "runas" situation.  Stinks that there isn't a way to automate the password portion --

I know there is a source forge project that provides a full-fledged app. that can launch items as another user, but it's not quite what we need.

What about user impersonation in VB?  Any ideas on that?

Thanks!
0
 

Author Comment

by:jgantes
ID: 18006210
I found a third party product (that I was originally avoiding) that will do everything I need from a CLI.

http://www.quimeras.com

I'll still need a program that opens up, prompts for a "daily passcode" and if correct, lets the person enter and click a button that launchs the my third party app w/ command line switches!
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 16

Accepted Solution

by:
Hillwaaa earned 225 total points
ID: 18006570
Hi jgantes - try this (was coded in VB .NET 2003):




Public Class Form1


    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()
        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Label1 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.TextBox1 = New System.Windows.Forms.TextBox
        Me.Button1 = New System.Windows.Forms.Button
        Me.Label1 = New System.Windows.Forms.Label
        Me.SuspendLayout()
        '
        'TextBox1
        '
        Me.TextBox1.Location = New System.Drawing.Point(136, 40)
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.TabIndex = 3
        Me.TextBox1.Text = ""
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(160, 136)
        Me.Button1.Name = "Button1"
        Me.Button1.TabIndex = 4
        Me.Button1.Text = "OK"
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(8, 40)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(112, 23)
        Me.Label1.TabIndex = 5
        Me.Label1.Text = "Enter daily postcode:"
        '
        'Form1
        '
        Me.AcceptButton = Me.Button1
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(256, 174)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.Button1)
        Me.Controls.Add(Me.TextBox1)
        Me.Name = "Form1"
        Me.Text = "Open Command Shell"
        Me.ResumeLayout(False)

    End Sub

#End Region


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If (Me.TextBox1.Text.Equals(CStr(Now.Day * 5))) Then

            Dim x As New System.Diagnostics.Process
            x.StartInfo.FileName = "runas.exe"
            x.StartInfo.Arguments = "/user:Domain\UserAccount cmd.exe"
            x.Start()
        Else
            MessageBox.Show("Invalid Passcode")
        End If

    End Sub
End Class
0
 
LVL 16

Expert Comment

by:Hillwaaa
ID: 18006575
You'll have to update the name of the application (and any arguments) - as well as change the daily passcode function if you don't want the day*5 formula.

Cheers,
Hillwaaa
0
 

Author Comment

by:jgantes
ID: 18008826
Thanks a ton Hilwaa!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question