I've created a batch file on our domain controller to export users based on the OU they are in.
I'd like to make this into a simple one form application that our admins can have access to. The problem is, every attempt I have made (I don't know much, so it's editing existing code I've found online) has failed.
The form design is only a text box (txtClientID) and a Go button.
Any assistance would be appreciated.
VB.NET:
@ECHO OFF
ECHO This tool will export all users in the chosen Active Directory OU.
ECHO.
ECHO The file will be saved to your desktop.
ECHO.
SET CHOICE=
SET /P Choice=Client ID?
csvde -f C:\Users\%username%\Desktop\AD_%CHOICE%.csv -r sAMAccountName=%CHOICE%* -l "sAMAccountName"
I'd like to make this into a simple one form application that our admins can have access to. The problem is, every attempt I have made (I don't know much, so it's editing existing code I've found online) has failed.
VB.NET:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Process.Start("C:\Windows\system32\csvde.exe -f C:\Users\%username%\Desktop\AD_{0}.csv -r sAMAccountName={0}* -l sAMAccountName", 0.txtClientID.Text)
End Sub
End Class
The form design is only a text box (txtClientID) and a Go button.
Any assistance would be appreciated.
Last edited: