Petri IT Knowledgebase Forums
 

Petri.co.il forums Home Forums Start Page Forums Frequently Asked Questions FAQ Member List Members List
Go Back   Petri IT Knowledgebase Forums > Windows Scripting > General Scripting
Petri.co.il is happy to award auglan the title of Most Valuable Member !!!
Register Calendar Calendar Search Petri IT Knowledgebase Forums Search Todays Posts Today's Posts Mark Forums Read

Notices

Change Permissions on bulk homedirs

Change Permissions on bulk homedirs

this thread has 2 replies and has been viewed 6430 times

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26th September 2007, 17:27
holler1 holler1 is offline
Banned
Casual
 
 Join Date: Feb 2005
  6 month star 12 month star
 Location: Haifa,Israel
 Posts: 23
  Send a message via Skype™ to holler1
 Reputation: holler1 is on a distinguished road (10)
Default Change Permissions on bulk homedirs

Hello all,
I have Win2k3 R2 standard edition as file server.
I have the next scernario:
Users has folder redirection of "My Documents" and "Application Data" to this server that building themselfes under the user's homedir.
Accidentally I forgot to remove the option of "Grant the user exclusive rights to My Documents" and the same thing on "Application Data", and now I can't get access to these folders in user's homedir.
There are several groups of homedirs, every group of homedirs are under their Root directory.
I would like to have some script that will inherit permissions FROM user's homedir TO the "My Documents" and "Application Data", or it's possible to inherit permissions to all subfolders and files, or it would be better to automate the option of " Replcae permission entries on all chikd objects with enttries shown here that apply to child objects" on all the homedirs.
I guess the script should do the next:
1. Scan / Read the current permissions of each directory / folder.
2. Inherit permissions from the user's root homedir.
3. Add the name of the folder to the security permissions with full control in adition to the inherited permissions that mentioned in paragraph 2 (The name of the folder is the username, there for I need to add the folder name to the security tab of the folder).

I hope my explanation was clear and there is nothing missing.
Hoping someone will help me ASAP.
Thanks ahead,
Boris Reuven

Last edited by holler1; 26th September 2007 at 17:38..
  #2  
Old 27th September 2007, 04:15
bonald bonald is offline
Casual
Casual
 
 Join Date: Sep 2007
  6 month star 12 month star
 Posts: 6
 Reputation: bonald is on a distinguished road (10)
Default Re: Change Permissions on bulk homedirs

i had success changing massive ntfs permission on home folders with hyena.
  #3  
Old 27th September 2007, 21:16
Rems's Avatar
Rems Rems is offline
Moderator
 
 Join Date: Mar 2005
  6 month star 12 month star
 Location: NL
 Posts: 2,268
 Reputation: Rems is a splendid one to beholdRems is a splendid one to beholdRems is a splendid one to beholdRems is a splendid one to beholdRems is a splendid one to beholdRems is a splendid one to beholdRems is a splendid one to beholdRems is a splendid one to behold (903)
Default Re: Change Permissions on bulk homedirs

Quote:
One of the available options of Folder Redirection is:
Grant the user exclusive rights to My Documents. If selected, this sets the NTFS security descriptor for the %username% folder to Full Control for the user and local system only; this means that administrators and other users do not have access rights to the folder. This option is enabled by default. Note: Changing this option after the policy has been applied to some users will only effect new users receiving the policy.
  1. The Ower (the user) and the buildin\system are the accounts that by default have full control over these folders, subfolders and content.

  2. To change NTFS permissions, you can use XCacls.vbs. Xcacls must be executed by one of those accounts from above.
    The Xcacls.vbs script should be run with Cscript.exe [ Cscript.exe xcacls.vbs /<switches and parameters> ]

So besites taking ownerschip (not the finest option) it looks like there are two more options you can try first;

1.
Use xcacls in a user logon-script, and wait for the user to re-logon.

2.
Schedule a task on the server that stores these user folders to run Xcacls as the buildin\system

When using Windows Scheduler, change the 'domain\Username' to 'System' and leave the password boxes empty! This way the task will run but hidden and not interactive. Or, you can use an AT.exe /Interactive command-line for the job.
AT.exe hh:mm /interactive Cscript.exe xcacls.vbs /<switches and parameters>
where hh:mm is the current time on the server plus 2 minutes.
(btw instead of using a scheduler to run the job, you can also use PsExec -s -i <...> to run it directly)

\Rems
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to change permissions on a System32 file biggles77 General Scripting 7 18th September 2007 18:56
setting up profiles and homedirs - procedure spoofer Windows Server 2000 / 2003 2 2nd May 2007 15:42
Script to change Diretory and File Permissions dlucas10 General Scripting 1 17th November 2005 08:32
Windows XP: Change permissions for Standard User versli Windows 2000 Pro, XP Pro 1 4th September 2005 00:39


All times are GMT +3. The time now is 19:45.

Steel Blue 3.5.4 vBulletin Style ©2006 vBEnhanced
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
 

Valid XHTML 1.0!   Valid CSS!

Copyright 2005 Daniel Petri