I was trying to deal with migrating two separate organizations where one org was redirecting My Documents to the network while the other org didn't and didn't want to. I came to the solution on Windows 7 by using Libraries. I needed to add the user's %homeshare% to the Documents Library. This brought up a number of issues including adding a network location without it being indexed. I figured out that I could create a symbolic link locally, pointing to the network location in Win7 and then add the symbolic link to Library. I also needed to do this for all of the W7 users and that meant it needed to be automated.
Using ShLib.exe from:
http://www.grimadmin.com/article.php/creating-modifying-windows-7-libraries
Here's the script:
set media=%~dp0
@echo off
echo Creating the folder to hold the Symbolic Link
md "%userprofile%\Libraries"
echo Creating the Symbolic Link
mklink /D "%userprofile%\Libraries\Network_Home" "%homeshare%"
echo Add the Symbolic Link to the Documents Library
%media%shlib add "%userprofile%\AppData\Roaming\Microsoft\Windows\Libraries\Documents.library-ms" "%userprofile%\Libraries\Network_Home"
echo Set the Symbolic Link as the default save location
%media%shlib setsaveloc "%userprofile%\AppData\Roaming\Microsoft\Windows\Libraries\Documents.library-ms" "%homeshare%"
After automating it the next issue was how to get around the UAC elevate prompt so users didn't have to "approve" the change. I was able to add the script and supporting files into SCCM as a Package and referenced the script as the Program.
The Advertisement was then setup with the following:
Advertised to All Clients
Limited to Windows 7 x64 and Windows 7 x86 (it might run on Vista, but I don't have and Vista machines)
Set to Run only when a user is logged on
Set to Run once for every user (advanced tab)
It works great, the user never sees a prompt and we've got a great solution for the entire organization.
No comments:
Post a Comment