Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change local folder security through AD

Posted on 2004-09-21
6
Medium Priority
?
311 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 750 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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.…
Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

722 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