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.
Set oFolder = fso.CreateFolder(dfolder)
fso.copyfile ofile.path, dfolder
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!