|
Alright, I found one problem w/ the error code 1314. It is "UserAccess Not Allowed"
The Help page for loadhive() mentions the need to have the user running it as having "Backup / Restore" rights.
I added "Domain Users" to the local "Backup Operators" group, and the 1314 went away.
Now, the section below that migrates the network drives is not working. The printers one is. On to troubleshoot this one.
Any ideas why the .reg file on the drives don't work and the printers do? the idea I'm running with is that the HKCU\Network\* keys define the persistent mapped drives that I want to move.
---------------------- IF @WKSTA = "NICKEL21" or @WKSTA = "NICKEL22" or @WKSTA = "NICKEL23" or @WKSTA = "NICKEL24" or @WKSTA = "NICKEL25"
; *BEGIN* Main Citrix Server Farm Loop Keep things between this line and the ending line
IF INGROUP ("eTIMEUsers") use T: /d; use T: "\\silver1\etime"; ENDIF
; ; Read HKEY_CURRENT_USER registry keys to see if something is there. We set these values at the end to mark it as "run once" ; We selected the subkey of HKEY_CURRENT_USER\Software\SchnitzerCitrix\ as our root key to check for this sort of thing. ; The below section maps 3 Drives (root of PERSONAL_SHARES, old Citrix Profile, and new P: Drive, then copies the needed ; files out of the old profile. The new Citrix Desktop profiles we limit to 30MB, so we move this to P instead. ;
; This variable and check for a reg key is how we "do this once" and "only once" ; If it is there, then we have done the work before, and we want to skip.
$CitrixCheckVar = ReadValue ("HKEY_CURRENT_USER\Software\SchnitzerCitrix", "2K3ProfileMigrateDone");
IF $CitrixCheckVar = 1 ? "This key exists, and therefore the ELSE Section has been done!"; ELSE
; temp mapping to copy shortcut files from root of personal_share use w: \\hydrogen3\personal_shares;
; temp mapping to copy files and folders from old profile use x: "\\corpfile\profiles\@USERID";
; temp mapping to copy files and folders to new P Drive use y: "\\hydrogen3\personal_shares\@USERID";
copy "X:\Desktop\*.*" "y:\OldCitrixDesktop\" /s ; copies the files from OLD Citrix TSE Desktop to new one copy "X:\Favorites\*.*" "c:\documents and settings\" + @userid + "\Favorites\" /s ; copies the files from OLD Citrix TSE Favorites to new one copy "P:\Internet\Favorites\*.*" "c:\documents and settings\" + @userid + "\Favorites\" /s ; copies the files from P: Favorites to new one copy "W:\*.lnk" "c:\documents and settings\" + @userid + "\Desktop\" ; copies a shortcut to P:\OldCitrixDesktop\ on new citrix desktop
;This section below reads the old NTUSER.DAT from the Windows 2000 (NICKEL1X Boxes) and exports ;mapped drives and printers from the HKEY_CURRENT_USER section of the registry, and then imports ;it to the new Windows 2003 User profile
$filename = "x:\ntuser.dat"; $rootkey = "HKEY_USERS\Oldprofile"; $ReturnCodeLoadHive = LoadHive($rootkey,$filename)
If $ReturnCodeLoadHive = 0 ? "Old Citrix Server Hive loaded....";
$ReturnCodeSavePrinter = SaveKey($rootkey + "\Printers\Connections", "x:\" + @USERID + "printers.reg");
If $ReturnCodeSavePrinter = 0 ? "Printers Key saved...."
$ReturnCodeLoadPrinter = LoadKey("HKEY_CURRENT_USER\Printers\Connections", "x:\" + @USERID + "printers.reg")
If $ReturnCodeLoadPrinter = 0 ? "Printers Key loaded...." Endif Endif
$ReturnCodeSaveDrives = SaveKey($rootkey + "\Network", "x:\" + @USERID + "drives.reg")
If $ReturnCodeSaveDrives = 0 ? "Network Drives Key saved...."
$ReturnCodeLoadDrives = LoadKey("HKEY_CURRENT_USER\Network", "x:\" + @USERID + "drives.reg")
If $ReturnCodeLoadDrives = 0 ? "Drives Key loaded...." Endif Endif ELSE ? "The Return Code is = $ReturnCodeLoadHive";
Endif
; Cleanup from what you've done above...
;unloads the loaded hive from above $ReturnCodeLoadHive = UnLoadHive( $rootkey );
;disconnects the drives we mapped above to migrate the files
use w: /d; use x: /d; use y: /d;
;Write the registry key that shows we've done this before, so it is not done again
Writevalue("HKCU\Software\SchnitzerCitrix","2K3ProfileMigrateDone","1","REG_SZ") ENDIF
|