Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing home folders on new server

Status
Not open for further replies.

Councilk

MIS
May 14, 2003
72
0
0
US
Hello all, I hope everyone is doing well.

I have a situation here where Im trying to compare the user home directory on the new Win2003 server with the home folders on the old server.

I want to print the folders which are not found to a logfile

This will give me an idea of the folders who werent migratd properly

I want to look through the local home folder location and compare this against the old home folder structure using the objfolder.name and objFolder.CreationDate properties

Please see the script I have below

Code========================================

NewSvr = "\####WFSP03\"
NewSvrPath = "\\&&&&WFSP03\e$\Home"

Wscript.Echo(NewSvrPath)

Checkpoint = "M:\Home"

Set objNetwork =CreateObject("Wscript.NetWork")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("E:\Home")
Set colSubfolders = objFolder.Subfolders

Here is where
i keep recieving a "expected
statement error"

objNetWork.MapNetWorkDrive "n:", & "\\****WFSP03\e$"

For Each objSubfolder in colSubfolders
Wscript.Echo objSubfolder.Name, objSubfolder.dateCreated
If ObjFSO.FolderExsist(NewSvrPath & objFolder.Subfolders) Then
wscript.echo "This folder exist"
Else
wscript.echo "This folder does not exists"

End If
Next

 
Replace this:
objNetWork.MapNetWorkDrive "n:", & "\\****WFSP03\e$"
with this:
objNetWork.MapNetWorkDrive "n:", "\\****WFSP03\e$"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I'm sorry, I should have updated this thread when I figured out the correct syntax. I've since gotten myself caught up in a different snag.

I know this can be done logically where I'm using a for next construct to pull the home foldername.

Once I pull the homefolder from server "A" I call a subroutine to try and peform the same function but it won't exit the subsequent for next construct

I feel like I'm getting closer

Please see the code below

'=============================================NewSvr = "\####WFSP03\"
NewSvrPath = "\\####WFSP03\e$\" & "Home"

Wscript.Echo(NewSvrPath)

Checkpoint = "N:\Home\"

Set objNetwork =CreateObject("Wscript.NetWork")

'==============Reset Home share search locations=========================================

'objNetwork.RemoveNetWorkDrive "N:"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("E:\Home")
Set colSubfolders = objFolder.Subfolders


If Err.Number <> 0 Then
on error resume next
'objNetWork.MapNetWorkDrive "N:", "\\####FSP01\e$\Home"
'objNetWork.MapNetWorkDrive "O:", "\\####FSP01\e$\Home"
End IF

'objNetWork.MapNetWorkDrive "O:", "\\####FSP01\e$\Home"


For Each objSubfolder in colSubfolders

Wscript.Echo objSubfolder.Name, objSubfolder.dateCreated

Set objFolder2 = objfso.GetFolder("\\####FSP01\e$\Home")
Set colSubFolder = objFolder2.Subfolders

Wscript.echo(objSubFolder.name)

Call CheckSec

'If ObjFSO.FolderExists(objFolder2) Then
' wscript.echo objFolder2 & " exist"
' Else
' wscript.echo objfolder2 & " does not exists"
'End If
Next

Sub Checksec

'Set objFolder2 = objfso.GetFolder("\\####FSP01\e$\Home")
Set objFolder2 = objfso.GetFolder("\\####FSP01\e$\Home")
Set colSubFolder2 = objFolder.Subfolders
Wscript.echo " This is checksec"

'This is the second for next construct I want to use

For Each objSubfolder2 in colSubfolder2
If ObjFSO.FolderExists(objSubFolder) Then
wscript.echo objsubfolder.name
wscript.echo objsubfolder & " is here"
wscript.echo "Cant locate folder"

end if

Next



'If ObjFSO.FolderExists(objSubFolder2) False Then
' wscript.echo
'End If

End Sub
' Else
' wscript.echo objfolder2 & " does not exists"
'End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top