Change the directory path in AD using VBS

Asked By 0 points N/A Posted on -
qa-featured

How can I change the directory path to all my users in Active Directory (AD) using a login Visual Basic Script (vbs) and how could I distinguish if the user accounts have a local administrative log in?

SHARE
Answered By 0 points N/A #96637

Change the directory path in AD using VBS

qa-featured

You can change the directory path in the active directory by getting the value of the Wscript shell objects' CurrentDirectory property. You have to note that the current directory property scripts will work well when you are running the windows script host version 5.6.

An example whereby a script has been used to change the current directory to another directory which is C:Windows is as indicated below:

Set objShell = CreateObject("Wscript.Shell")

Wscript.Echo objShell.CurrentDirectory

objShell.CurrentDirectory = "C:Windows"

Wscript.Echo objShell.CurrentDirectory
 

In the last line of the script, you will note that the script C:Windows will be changed to the current directory after you have run the script.

Regards
Thompson Locker

Login/Register to Answer

Related Questions