Forum Discussion
Ryan0000
Dec 08, 2021Copper Contributor
Powershell Script to move Profile, Mapped Drives, Printers, and Files
I'm trying to find some example scripts to migrate Windows 10 user profiles to a new computer, but haven't had any luck with my searches. I just started a new job and have about 60 desktops to swap ...
Ryan0000
Jan 29, 2022Copper Contributor
I agree...configuring things from the domain would be nice. I'm not currently a domain admin, but am the office admin of about 55 workstations + laptops for those folks. The drive mappings are going to a server I control permissions to... I have already worked out the script that handles the mappings.
I really just need to find a way to migrate bookmarks/favorites/etc in web browsers if I can write a script to do that.
I really just need to find a way to migrate bookmarks/favorites/etc in web browsers if I can write a script to do that.
- Feb 03, 2022Did this work for you?
- Jan 29, 2022
Ryan0000 I made a copy script for that, replace d:\backup with your own path. h:\backup is h:\ is the homedirectory of the user, you could run it during login using a Group Policy User Logon Script or similar.
Backup:
#Google Chrome Backup Bookmarks if (Test-Path "$($env:LOCALAPPDATA)\Google\Chrome\User Data\Default\Bookmarks") { if (-not (test-path d:\Backup\Chrome)) { New-Item -Path d:\Backup\Chrome -Type Directory -Force:$true } Copy-Item -Path "$($env:LOCALAPPDATA)\Google\Chrome\User Data\Default\Bookmarks" -Destination d:\Backup\Chrome\ -Force:$true -Confirm:$false } #Google Edge Backup Bookmarks if (Test-Path "$($env:LOCALAPPDATA)\Microsoft\Edge\User Data\Default\Bookmarks") { if (-not (test-path d:\Backup\Edge)) { New-Item -Path d:\Backup\Edge -Type Directory -Force:$true } Copy-Item -Path "$($env:LOCALAPPDATA)\Microsoft\Edge\User Data\Default\Bookmarks" -Destination d:\Backup\Edge\Bookmarks -Force:$true -Confirm:$false } #Mozilla Firefox Backup Bookmarks if (Test-Path "$($env:APPDATA)\Mozilla\Firefox\Profiles") { if (-not (test-path d:\Backup\FireFox)) { New-Item -Path d:\Backup\FireFox -Type Directory -Force:$true } $MozillaPlaces = (get-childitem "$($env:APPDATA)\Mozilla\Firefox\Profiles" -force -recurse -ErrorAction SilentlyContinue | where-object { $_.Name -eq 'places.sqlite' }).DirectoryName copy-item -path "$MozillaPlaces" -Destination d:\Backup\Firefox -Force:$true -Confirm:$false }
Restore:
#Google Chrome Restore Bookmarks if (Test-Path "$($env:LOCALAPPDATA)\Google\Chrome\User Data\Default\Bookmarks") { if (test-path d:\Backup\Chrome) { Copy-Item -Path d:\Backup\Chrome\bookmarks -destinatiom "$($env:LOCALAPPDATA)\Google\Chrome\User Data\Default\" -Force:$true -Confirm:$false } } #Google Edge Restore Bookmarks if (Test-Path "$($env:LOCALAPPDATA)\Microsoft\Edge\User Data\Default\Bookmarks") { if (test-path d:\Backup\Edge) { Copy-Item -Path d:\Backup\Edge\bookmarks -destination "$($env:LOCALAPPDATA)\Microsoft\Edge\User Data\Default\" -Force:$true -Confirm:$false } } #Mozilla Firefox Restore Bookmarks # To copy it back... SIDE NOTE*** if mozilla being re-installed or fresah installed, must open mozilla first to recreate a default place.sqlite to replace if (Test-Path "$($env:APPDATA)\Mozilla\Firefox\Profiles") { if (test-path d:\Backup\FireFox) { $MozillaPlaces = (get-childitem "$($env:APPDATA)\Mozilla\Firefox\Profiles" -force -recurse -ErrorAction SilentlyContinue | where-object Name -eq 'places.sqlite').DirectoryName Copy-Item D:\Backup\FireFox\*.* -Recurse -Destination "$($MozillaPlaces)" -Force:$true -Confirm:$false } }
Please test this, I only tested backupping everything, not the restore part 😛