Solved

Change local folder security through AD

Posted on 2004-09-21
6
304 Views
Last Modified: 2010-04-19
I have an application that all my users use, in the application there is a way to configure certain keys to do certain functions. When this is changed the users get an error that they are unable to update the config file. I fixed this issue by loggin in as admin and changing the security on the folder to read/write. The when the user logs in he can make changes. Is there a script or something to change the folder security or do i need to go to every pc and do it.
0
Comment
Question by:ICINTRACOM
  • 3
  • 2
6 Comments
 
LVL 25

Assisted Solution

by:mikeleebrla
mikeleebrla earned 250 total points
ID: 12115103
you can do it though the administrative share,,, either one by one or with a script:

the local admin share is \\hostname\C$

0
 
LVL 5

Author Comment

by:ICINTRACOM
ID: 12115689
not sure that will work. I don't want to share the folder, i just want the security on the folder to be set for everyone have read/write permissions. the folder is in the root of c:
0
 
LVL 25

Expert Comment

by:mikeleebrla
ID: 12115729
it will work,, the folder is shared already by default on all windows systems for administrative purposes... i never instructed you to create a new share at all.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 5

Author Comment

by:ICINTRACOM
ID: 12115797
You are correct sorry. Now how can i change the security on the folder through a vb script.
0
 
LVL 25

Expert Comment

by:mikeleebrla
ID: 12115891
that i do not know as i dont really use scripts very much at all.
0
 
LVL 83

Accepted Solution

by:
oBdA earned 250 total points
ID: 12116897
You can do it from the command line using cacls:
cacls \\RemoteMachine\C$\FolderName /t /e /g User:C

The following script can change either a single remote machine, passed as argument, or a list of machines (one machine name per line); for the list, use /L as the first argument, the path and name of the list file as second argument. Just adjust the settings at the beginning (and maybe the line with the permissions, if necessary). Note that the script is currently in test mode, it will only echo the command it would otherwise execute. Remove the ECHO where indicated to run it for real. Oh, and if it's processing a list of machines, it will give you a list of machines (changesec.txt, in the script's directory) where the change wasn't applied, because they were turned off. Rename this file before you use it as list file for another round!
example:
changesec remotemachine
changesec /L machinelist.txt

====8<----[ChangeSec.cmd]----
@echo off
setlocal
set TargetFolder=C$\SomeFolder
set FailedFile=%~dpn0.txt

if %1.==. goto leave
if /i not %1.==/L. goto process
if %2.==. goto leave
set MachineFile=%2
set MachineFile=%MachineFile:"=%
if not exist "%MachineFile%" goto leave
:: *** Process a list of machines:
if exist "%FailedFile%" del "%FailedFile%"
for /f %%a in ('type "%MachineFile%"') do call :process %%a
goto leave

:process
set Machine=%1
set Machine=%Machine:\=%
echo Processing %Machine% ...
ping -n 1 %Machine% | find "TTL" >NUL
if errorlevel 1 goto :NoResponse
:: *** Set the permissions on the target folder:
:: *** Test mode: Remove the ECHO in the following line to run the script for real:
ECHO cacls "\\%Machine%\%TargetFolder%" /t /e /g Users:C
goto :eof

:NoResponse
echo ... not responding.
if not "%MachineFile%"=="" >>"%FailedFile%" echo %Machine%
goto :eof

:leave
====8<----[ChangeSec.cmd]----
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Looking for easy way to upgrade Windows 2003 Server to 2012 2 81
Backup DHCP Server 8 104
Exchange 2003 converted to VM but now email does not work 5 67
Auto Login Script 3 40
by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now