Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Copying NK2 files from TS Profiles to new TS .V2 Profile.

Avatar of ihotdesk
ihotdeskFlag for United Kingdom of Great Britain and Northern Ireland asked on
OutlookMicrosoft ApplicationsVB Script
4 Comments1 Solution1234 ViewsLast Modified:
Hi there,

I am wanting to create a script to copy users NK2 file from their old profile to their new one when logged into the new TS server. The old TS server was a 2003 Server (hence old profiles...documents and settings)

The new TS server is a 2008 server, therefore new V2 profile. I have tried using this script:


Dim WshShell : Set WshShell = Wscript.CreateObject("Wscript.Shell")
Dim fso : Set fso = Wscript.CreateObject("Scripting.FileSystemObject")
Dim oNet : Set oNet = Wscript.CreateObject("Wscript.Network")
Dim WshEnv : Set WshEnv = WshShell.Environment("Process")
SysDrive = WshEnv("%SystemDrive%")

sFolder = "\\serverdc01\tsprofiles$" & oNet.Username & "\Application Data\Microsoft\Outlook" 'folder to look in
dFolder = SysDrive & "\users\" & oNet.Username & "\appdata\roaming\microsoft\outlook"
IF fso.FolderExists(sFolder) Then


Set oFolder = fso.GetFolder(sFolder)
Set oFiles = oFolder.Files
FOR Each oFile In oFiles
ext = fso.GetExtensionName(oFile)
' check if characters in file extension is "NK2"
IF UCase(ext) = "NK2" Then
Wscript.Echo "NK2 file exists" 'Backup the file NK2 to a server.
Wscript.Echo ext

Set oFolder = fso.CreateFolder(dfolder)
fso.copyfile ofile.path, dfolder
End If
Next
End If


But it doesnt seem to work. I'm not very good at vbscripts so thats probably why! Can anyone advise on this or advise an easy way to do this. They really need the nk2 copied from their old profile location to their new profile. One thing I did notice was that on the old server the profile folders are all username.domainname

e.g.   jsoap.example   (domain being: example)

Anyone have any helpful tips for me to try? Thanks in advance!
ASKER CERTIFIED SOLUTION
Avatar of MaxSoullard
MaxSoullardFlag of United Kingdom of Great Britain and Northern Ireland image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers