Command-line from VBA

SteveC24

Registered User.
Local time
Today, 17:07
Joined
Feb 1, 2003
Messages
444
Hello,

This is a 2 parter - I need to run a command-line from within VBA. I have a command to disable a user account in active directory through the command line, but would IDEALLY like to be able to enter the username into the database form, it then to pass that username to the command line, putting it in the right place in the command line.

Can anyone help?


Thank you VERY much!
 
Steve,

You need to use the Shell Command. Use the Search Facility here,
there are plenty of examples. That should get you started.

If you need to Shell&Wait (wait for the process to complete), post
back & I'll find you a sample.

Wayne
 
Super - thank you! :)

Works beautifully! I am disabling/enabling and changing passwords all over the place now, all from the comfort of my database!

Thank you!
 
You should look at connecting to the Active Directory usind ADO and the ADsDSOObject.. check some of my posts for LDAP to try and find documentation about this.
 
Hi,
This really interests me after reading the first post but can not find what steve must of found on how to do it. I think I may be a bit more novice. Have you got anything I can look at or a better description of what to do, to be able to disable user accounts from within a database.
Thank You
Keith
 
Hello Keith,

This was so long ago, I have completely forgotten how I did it - it wasn't anything terribly technical.

I ended up running a command line command using (I believe) the 'net' command.

I seem to remember it was something using "net user".

If you get a command line up, and enter "net user ?" that should give you the next subset of commands you can use - it was all relatively simple.

Unfortuantely, I have left the employment of where I did this originally, so can't come up with the precise commands I used - but I know it didn't take long once I had Access accepting command line code through VBA.

Good luck!
 

Users who are viewing this thread

Back
Top Bottom