≡ Menu

take ownership and add full control

command line for taking ownership and adding full control of directory

An important part of non-standard locations with complicated products is appropriate control of the installation and temorary file directories. There are several ways to quickly validate file and folder permissions, especially when multiple users are involved in setting up installation or patching files on multiple environments. This works for making the service account an owner with full control:

TAKEOWN /s /f "C:\Temp" /r /d y
TAKEOWN /s /f "C:\Temp" /r /d y
TAKEOWN /s /f "C:\Temp" /r /d y
TAKEOWN /s /f "C:\Temp" /r /d y
TAKEOWN /s /f "C:\Temp" /r /d y
TAKEOWN /s /f "C:\Temp" /r /d y
TAKEOWN /s /f "C:\Temp" /r /d y
ICACLS \\\c$\Temp /grant domain.com\serviceaccountname:(OI)(CI)F
ICACLS \\\c$\Temp /grant domain.com\serviceaccountname:(OI)(CI)F
ICACLS \\\c$\Temp /grant domain.com\serviceaccountname:(OI)(CI)F

steps

Prerequisite: Local or Domain Administrator access
Begin by modifying the code above in a text editor for the target environment.
Execute via cut and paste to cmd, or as part of more complicated scripted process.

description

Take ownership and add full control on a directory in Windows 2008 R2 Server.
Next would be to turn off read-only.

external links

None at this time


{ 0 comments… add one }

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.