Page 1 of 2 12 LastLast
  1.    16 Jan 2016 #1
    Join Date : Jun 2015
    Posts : 278
    Windows 10

    takeown problem


    Hi

    I have Windows 10 v1511 Enterprise 64 bit with two Microsoft account.

    From the Command Prompt (run as administrator), I tried to write

    Code:
    takeown /S localhost /U "<Microsoft_account_(E-Mail_Address)>" /P <User_password>" /F "<Directory_path>" /R /A /D Y
    but I get the "Access Denied" error. Why?

    Thanks

    Bye
      My ComputerSystem Spec
  2.    16 Jan 2016 #2
    Join Date : Aug 2014
    Auckland
    Posts : 74
    Windows 10 Pro X64

    I don't know answer to your question, but the easiest (best) way to take ownership is to use Brink's registry hack which will add "Take Ownership" to the file/folder context menu.

    I have attached a copy with two others that are very useful.

    :-
    takeown problem Attached Files
      My ComputerSystem Spec
  3.    17 Jan 2016 #3
    Join Date : Jun 2015
    Posts : 278
    Windows 10
    Thread Starter

    If I write the net user command, the profile names of the Microsoft accounts are displayed.

    If, however, I write

    Code:
    takeown /S localhost /U "<Account_profile_name>" /P "<Password>" /F "<Directory_path>" /R /A /D Y
    Windows indicates that this user does not exist.

    Also, if I try to activate the hidden administrator

    Code:
    net user Administrator /Active:yes
    net user Administrator "<Password>"
    and then I try to write

    Code:
    takeown /S localhost /U Administrator /P "<Password>" /F "<Directory_path>" /R /A /D Y
    Windows always indicates that this user does not exist.

    So, how should I use the /U option of takeown?

    Thanks

    Bye
      My ComputerSystem Spec
  4.    17 Jan 2016 #4
    Join Date : Jul 2015
    Posts : 3,808
    10 Pro

    The /U switch is only applicable to remote computers and so you are trying to change the ownership on a remote computer called localhost which almost certainly doesn't exist.

    Even if you specify the name of your local PC (not localhost) you'll get an error WARNING: User credentials cannot be used for local connections.

    It isn't clear what you are attempting here as you seem to be trying to change the owner to the built in Administrator user and also the Administrators group with the /A switch.

    Assuming you want to change the owner to built in administrator you have various options.
    Code:
    runas /user:Administrator "takeown /F "<file path> /R""
    or, if you prefer probably a better solution is
    Code:
    icacls "<folder path>" /setowner Administrator /t
      My ComputerSystem Spec
  5.    17 Jan 2016 #5
    Join Date : Jun 2015
    Posts : 278
    Windows 10
    Thread Starter

    Quote Originally Posted by lx07 View Post
    The /U switch is only applicable to remote computers and so you are trying to change the ownership on a remote computer called localhost which almost certainly doesn't exist.

    Even if you specify the name of your local PC (not localhost) you'll get an error WARNING: User credentials cannot be used for local connections.

    It isn't clear what you are attempting here as you seem to be trying to change the owner to the built in Administrator user and also the Administrators group with the /A switch.

    Assuming you want to change the owner to built in administrator you have various options.
    Code:
    runas /user:Administrator "takeown /F "<file path> /R""
    or, if you prefer probably a better solution is
    Code:
    icacls "<folder path>" /setowner Administrator /t
    If, from the command prompt (run as administrator), I had to write

    Code:
    takeown /F "<Directory_path>" /R /A /D Y
    icacls "<Directory_path>\*" /setowner Administrators /t
    icacls "<Directory_path>\*" /grant:r Administrators:F /t
    del /s /q "<Directory_path>\*.*"
    pushd "<Directory_Path>" && ( rd /S /Q "<Directory_Path>\" 2>nul & popd )
    I could delete the entire content of the directory structure even if its owner does not have read rights? If not, how do I remove this content?

    Thanks

    Bye
    Last edited by balubeto; 19 Jan 2016 at 04:06.
      My ComputerSystem Spec
  6.    19 Jan 2016 #6
    Join Date : Jun 2015
    Posts : 278
    Windows 10
    Thread Starter

    I always get the "Access Denied" error when I run the commands icacls. Why?

    It is possible to delete all the DACLs of this subdirectory, its files and its subdirectories and then give them those of its home directory? If so, how do I do this?

    Thanks

    Bye
      My ComputerSystem Spec
  7.    19 Jan 2016 #7
    Join Date : Jul 2015
    Posts : 3,808
    10 Pro

    You have been asking the same question here and on other sites for months. Authority is quite simple. To do something with an object you must have authority to do it. Either you do or you don't.

    To grant authority to some object you must either be the owner or have authority to do so.

    The simplest way therefore is to take ownership (with takeown) and then grant yourself authority with icacls.

    You do not need to change authority to someone else (either Administrator or the Administrators group)

    I do have to wonder though (when you could have just typed in /?) why you keep asking the same question.

    You are making it far more complex than it is. All you need to do is take ownership, change authority and do what you want.

    That is all.

    If you have a specific problem then post the error message (and what you are trying to do and why) and we will see if we can figure it out.
      My ComputerSystem Spec
  8.    26 Jan 2016 #8
    Join Date : Jun 2015
    Posts : 278
    Windows 10
    Thread Starter

    I think I found the best solution to remove a directory structure which also contains symbolic links and with ACLs managed by TrustedInstaller or Authenticated Users or System users:

    Code:
    takeown /F "<Directory_path>" /A /R /D Y /SKIPSL >nul 2>&1
    icacls "<Directory_path>" /reset
    icacls "<Directory_path>" /grant:r Administrators:(OI)(CI)F /inheritance:e /Q /C /T /L >nul 2>&1
    pushd "<Directory_path>" && ( rd /S /Q "<Directory_path>" 2>nul & popd )
    Many thanks to all

    Bye
    Last edited by balubeto; 27 Jan 2016 at 03:39.
      My ComputerSystem Spec
  9.    26 Jan 2016 #9
    Join Date : Jul 2015
    Posts : 3,808
    10 Pro

    Glad you got it working

    Are you sure about that first command though?

    Perhaps you aren't using English but /D S means you are defaulting S. Should it not be Y or N?
      My ComputerSystem Spec
  10.    27 Jan 2016 #10
    Join Date : Jun 2015
    Posts : 278
    Windows 10
    Thread Starter

    Quote Originally Posted by lx07 View Post
    Glad you got it working

    Are you sure about that first command though?

    Perhaps you aren't using English but /D S means you are defaulting S. Should it not be Y or N?
    Right. Now, I correct it.

    Thanks

    Bye
      My ComputerSystem Spec

 
Page 1 of 2 12 LastLast


Similar Threads
Thread Forum
Password problem or Windows Live Account problem
Cannot remember password, OR typed it in wrong on both entries. When I use the tool for recovering/resetting the password. The system takes me to a reset function, where I am able to put in a new password twice, but the screen that follows does not...
User Accounts and Family Safety
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 03:25.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums