Solved

Change local folder security through AD

Posted on 2004-09-21
6
309 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 85

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

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.…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

623 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