qvn7
asked on
Is there a VB script to locate one or more home directories for a user?
Is there a way, either VB script or batch file, to locate one or more home directories for a user?
For example, my LAN ID, qnguye01, is found on two Windows file cluster nodes. I want to be able to run a VB script or batch file to locate other end users' home directories, if they have one or more floating around somewhere.
TY,
Quan
For example, my LAN ID, qnguye01, is found on two Windows file cluster nodes. I want to be able to run a VB script or batch file to locate other end users' home directories, if they have one or more floating around somewhere.
TY,
Quan
where will this script run?
ASKER
@ xylog:
Thanks, but what I need is to locate other home directories that isn't the main one under the "Profile" tab in Active Directory.
My main home directory folder is located here:
\\HomeServer1\SharedDrive1 \SharedVol 1\qnguye01
I recently found out that I had another one located somewhere else, like:
\\HomeServer3\SharedDrive4 \SharedVol 3\qnguye01
Is there a way to locate multiple home directories either using VB script, batch file or dsquery commands?
Thanks!!!
Thanks, but what I need is to locate other home directories that isn't the main one under the "Profile" tab in Active Directory.
My main home directory folder is located here:
\\HomeServer1\SharedDrive1
I recently found out that I had another one located somewhere else, like:
\\HomeServer3\SharedDrive4
Is there a way to locate multiple home directories either using VB script, batch file or dsquery commands?
Thanks!!!
ASKER
@ aikimark
Where will this script run? Either my primary workstation or one of the file servers hosting the home directories data.
Where will this script run? Either my primary workstation or one of the file servers hosting the home directories data.
If you want to locate a directory with a specific name in a specified location you can use a series of "if exist" statements in a batch file:
findhomes.bat
==========
@echo off
if exist \\HomeServer1\SharedDrive1 \SharedVol 1\%1 echo \\HomeServer1\SharedDrive1 \SharedVol 1\%1
if exist \\HomeServer3\SharedDrive4 \SharedVol 3\%1 echo \\HomeServer3\SharedDrive4 \SharedVol 3\%1
===========
to run:
findhomes qnguye01
Alternatively if you want to search the entire hard drive you can enumerate all the directories with a dir statement:
dir /ad /s |findstr qnguye01
This is a bit slow if you have many directories (say, more than several hundred)
There is a middle ground if you have many volumes you can loop thru them like so:
for /d %%i in (\\HomeServer1\SharedDrive 1\*) do if exist %%i\%1 echo %%i\%1
If you have multiple shares we can loop thru them with the net view command. For multiple servers best bet is to loop thru a list in a text file.
findhomes.bat
==========
@echo off
if exist \\HomeServer1\SharedDrive1
if exist \\HomeServer3\SharedDrive4
===========
to run:
findhomes qnguye01
Alternatively if you want to search the entire hard drive you can enumerate all the directories with a dir statement:
dir /ad /s |findstr qnguye01
This is a bit slow if you have many directories (say, more than several hundred)
There is a middle ground if you have many volumes you can loop thru them like so:
for /d %%i in (\\HomeServer1\SharedDrive
If you have multiple shares we can loop thru them with the net view command. For multiple servers best bet is to loop thru a list in a text file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for ALL of your help!!! Have a good day!!!
great, please close the question and choose the answer/s you like
dsquery user -samid usernam|dsget user -hmdir