Solved

Change local folder security through AD

Posted on 2004-09-21
6
301 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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 82

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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.…
Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

14 Experts available now in Live!

Get 1:1 Help Now