Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted
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).

Posted

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...

Posted

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

Posted
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.

Posted
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.

Posted
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.

Posted
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.
Posted

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

Posted

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.

Posted
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

Posted

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?

Posted
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.

Posted

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.

  • 3 weeks later...
Posted

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

Posted

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

Posted
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

Posted
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

Posted
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.

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...