robbied69 Posted August 21, 2008 Posted August 21, 2008 Hi, I am just wondering the best way to tweak Folder Redirection. We have it implemented here on our Vanilla network. However, I am finding people with ove 5GB of music on in their My Music folder and its taking a lot of disk space. My boss doesn't seem to care for some reason. So I want to implement a way whereby the My Music | My Picture folders do not get redirected to the server but to the user's profile on the C: Drive so at least they have music and personal photo's but its not being backed up. Many Thanks
kmount Posted August 21, 2008 Posted August 21, 2008 We use a login script to do it as I found the AD implementation a bit slack on what it allows to be redirected. Our script creates a "stuff not backed up" folder in My Documents which our back up script ignores, and also it ignores the "My Music" folder amongst others for the very reason you describe.
robbied69 Posted August 21, 2008 Author Posted August 21, 2008 What server OS do you use? Z Server 2003 64-bit. I think I recall reading somewhere that Server 2008 takes care of this, hopefully.
Michael Posted August 21, 2008 Posted August 21, 2008 We use a login script to do it as I found the AD implementation a bit slack on what it allows to be redirected. Our script creates a "stuff not backed up" folder in My Documents which our back up script ignores, and also it ignores the "My Music" folder amongst others for the very reason you describe. This doesn't solve the issue of users using 5GB worth of disk space though does it? I see two solutions to this problem - either introduce quotas to your users or alternatively schedule a script to run overnight which searches and deletes any MP3 files found (for example).
FN-GM Posted August 21, 2008 Posted August 21, 2008 These VBS logon scripts will do what you want - You will need to change the destination path ' Variable Initilisations Set objShell = CreateObject("WScript.Shell") Set objNetwork = CreateObject("WScript.Network") strUserName = objNetwork.UserName strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\My Pictures" strRedirectionPath = "T:\Folder" ' Write the new Favorites path objShell.RegWrite strRegKey, strRedirectionPath ' Variable Destruction Set objShell = Nothing Set objNetwork = Nothing ' Variable Initilisations Set objShell = CreateObject("WScript.Shell") Set objNetwork = CreateObject("WScript.Network") strUserName = objNetwork.UserName strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\My Music" strRedirectionPath = "T:\Folder" ' Write the new Favorites path objShell.RegWrite strRegKey, strRedirectionPath ' Variable Destruction Set objShell = Nothing Set objNetwork = Nothing This doesn't solve the issue of users using 5GB worth of disk space though does it? I see two solutions to this problem - either introduce quotas to your users or alternatively schedule a script to run overnight which searches and deletes any MP3 files found (for example). Or you could just block the file format...
FN-GM Posted August 21, 2008 Posted August 21, 2008 Edited them so they go to the local user profile ' Variable Initilisations Set objShell = CreateObject("WScript.Shell") Set objNetwork = CreateObject("WScript.Network") strUsername = objNetwork.UserName sUser = objNetwork.username strUserName = objNetwork.UserName strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\My Pictures" strRedirectionPath = "C:\Documents and Settings\" & SUser & "\My Documents\My Pictures" ' Write the new Favorites path objShell.RegWrite strRegKey, strRedirectionPath ' Variable Destruction Set objShell = Nothing Set objNetwork = Nothing ' Variable Initilisations Set objShell = CreateObject("WScript.Shell") Set objNetwork = CreateObject("WScript.Network") strUsername = objNetwork.UserName sUser = objNetwork.username strUserName = objNetwork.UserName strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\My Music" strRedirectionPath = "C:\Documents and Settings\" & SUser & "\My Documents\My Music" ' Write the new Favorites path objShell.RegWrite strRegKey, strRedirectionPath ' Variable Destruction Set objShell = Nothing Set objNetwork = Nothing Message to mods: sorry about the double post it looks easier to separate them
Michael Posted August 21, 2008 Posted August 21, 2008 Or you could just block the file format... This would just stop it from running in Media Player. A user could still copy the files to their directory, couldn't they? In the longterm quotas are definitely the answer. If a user chooses to fill it up with MP3s, then that isn't your problem.
FN-GM Posted August 21, 2008 Posted August 21, 2008 This would just stop it from running in Media Player. A user could still copy the files to their directory, couldn't they? Nope that can be stopped using the R2 file server features you can use File Server Resource Manager and block them under file screening.
kmount Posted August 21, 2008 Posted August 21, 2008 This doesn't solve the issue of users using 5GB worth of disk space though does it? I see two solutions to this problem - either introduce quotas to your users or alternatively schedule a script to run overnight which searches and deletes any MP3 files found (for example). It solves it from a network storage angle given I couldn't care less how much they use on their local device. I'd discourage deletion of mp3 files as we once tried this and ended up causing more problems than it fixed with our media students.
Face-Man Posted August 21, 2008 Posted August 21, 2008 If you have "my music" as a folder in there profile you could use a GPO option to ignore my music (or any other folder). You just need to add it to "user configuration\administative template\system\user profiles\exclude directories in roaming profile". If "my documents" is mapped to their home dirve you could run a logout script to delete my music.
FN-GM Posted August 21, 2008 Posted August 21, 2008 What type of profiles do you use? One they know if they save things to my pictures and my music and they dont save wont they make another folder? Z
robbied69 Posted August 21, 2008 Author Posted August 21, 2008 Thanks for the scripts will give them a go after lunch. Where you have put the following line: "C:\Documents and Settings\" & SUser & "\My Documents\My Music" would this work: "%USERPROFILE%\My Documents\My Music" ? P.s. I would like to delete them, but a lot of users listen to stuff here and my boss would like to keep it that way. So we've just decided to move it to there local profile (as we're not using roaming types) and they can listen to there hearts content, but not being backed up which is ideal for us.
FN-GM Posted August 21, 2008 Posted August 21, 2008 for the group policy you just put my music. If you want to store them locally you will have to use them scripts. Z
robbied69 Posted August 21, 2008 Author Posted August 21, 2008 Edited them so they go to the local user profile ' Variable Initilisations Set objShell = CreateObject("WScript.Shell") Set objNetwork = CreateObject("WScript.Network") strUsername = objNetwork.UserName sUser = objNetwork.username strUserName = objNetwork.UserName strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\My Pictures" strRedirectionPath = "C:\Documents and Settings\" & SUser & "\My Documents\My Pictures" ' Write the new Favorites path objShell.RegWrite strRegKey, strRedirectionPath ' Variable Destruction Set objShell = Nothing Set objNetwork = Nothing ' Variable Initilisations Set objShell = CreateObject("WScript.Shell") Set objNetwork = CreateObject("WScript.Network") strUsername = objNetwork.UserName sUser = objNetwork.username strUserName = objNetwork.UserName strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\My Music" strRedirectionPath = "C:\Documents and Settings\" & SUser & "\My Documents\My Music" ' Write the new Favorites path objShell.RegWrite strRegKey, strRedirectionPath ' Variable Destruction Set objShell = Nothing Set objNetwork = Nothing Hi, I ran this script and nothing has changed. I'm not sure if it has worked or not. I have checked my reg settings and the location of the key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\My Pictures is now: C:\Documents and Settings\myname\My Documents\My Pictures However, I cannot navigate to this folder as it doesn't exist. Also, when I go into My Documents and right click My Pictures, the storage location is still: \\servername\share$\username\My Documents\My Pictures I am assuming it should have changed? to the registry setting. Have you encountered this before? thanks
FN-GM Posted August 21, 2008 Posted August 21, 2008 is should do yes, try saving something in there and see if it saves on the computer or on the server. Did you use it as a login script?
robbied69 Posted August 21, 2008 Author Posted August 21, 2008 is should do yes, try saving something in there and see if it saves on the computer or on the server. Did you use it as a login script? I just have and it saves on the server. I did use it as a login script. I created a GPO in User Configuration | Windows Settings |Scripts | Logon The VBS file is in the correct folder.
FN-GM Posted August 21, 2008 Posted August 21, 2008 what happens if you run it manually? Z Edit: I might know the problem, the registery doesnt know what to do with the " & SUser & ". Try changing it with a folder in the C drive to test it. Then save something and see it it saves in that folder.
kmount Posted August 21, 2008 Posted August 21, 2008 You could use %USERNAME% which is how we reference things in our login scripts.
SYNACK Posted August 21, 2008 Posted August 21, 2008 When you redirect them using the regestry it will not copy or move the files automatically they will have to be moved manually or by a script to the new location. You may be able to make a group policy adm template to be able to redirect without using a script if you want to, more information here: http://www.edugeek.net/forums/windows/15530-stop-certain-folders-propagating-server-laptops.html#post155922
robbied69 Posted September 11, 2008 Author Posted September 11, 2008 Hi, Sorry have not really had a chance to look into this since last post, have only started getting back onto this again. Just to confirm what I've done. I am using the vbscript below: ' Variable Initilisations Set objShell = CreateObject("WScript.Shell") Set objNetwork = CreateObject("WScript.Network") strUsername = objNetwork.UserName sUser = objNetwork.username strUserName = objNetwork.UserName strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\My Pictures" strRedirectionPath = "%USERNAME%\Personal Data\My Pictures" ' Write the new Favorites path objShell.RegWrite strRegKey, strRedirectionPath ' Variable Destruction Set objShell = Nothing Set objNetwork = Nothing I have created a GPO whereby this script runs at logon. At present the result I am getting is that: When I look in regedit: the registry key has been changed for my pictures to: %USERNAME%\Personal Data\My Pictures However, when I go into the users 'My documents folder' the My Pictures folder now appears as '%s's pictures'. This is still being directed to the server, not the local user profile. If I save a file manually inside this folder it still appears on the server. Does anyone know what's going wrong? Many Thanks Robert
SYNACK Posted September 11, 2008 Posted September 11, 2008 Umm shouldn't it be something like strRedirectionPath = "C:\Documents and Settings\" & sUser & "\Local Settings\Personal Data\My Pictures" as at the moment the path would go to nowhere
robbied69 Posted September 11, 2008 Author Posted September 11, 2008 Umm shouldn't it be something like strRedirectionPath = "C:\Documents and Settings\" & sUser & "\Local Settings\Personal Data\My Pictures" as at the moment the path would go to nowhere does it understand " & sUser & "? I've never heard of it before
robbied69 Posted September 11, 2008 Author Posted September 11, 2008 does it understand " & sUser & "? I've never heard of it before Actually I've seen that it works. However, it is still not saving in the relevant place, even though the registry is pointing to the new place. I don't know if its a problem. But under the type column, for all other reg keys the word 'REG_EXPAND_SZ' appears, whereas the key for this is 'REG_SZ'. Does anyone know if this will cause an issue? Thanks
SYNACK Posted September 11, 2008 Posted September 11, 2008 Actually I've seen that it works. However, it is still not saving in the relevant place, even though the registry is pointing to the new place. I don't know if its a problem. But under the type column, for all other reg keys the word 'REG_EXPAND_SZ' appears, whereas the key for this is 'REG_SZ'. Does anyone know if this will cause an issue? Thanks The & sUser & bit is actually running in VBScript rather than the regestry so all the registrey sees it the appropriate data. The difference between 'REG_SZ' and 'REG_EXPAND_SZ' is that the first will not expand environment variables like %USERNAME% where as the latter will. If the value is right this should not have any effect on your script as it expands the variable beforehand in VB. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now