Share all folders and files between two OSX partitions

So I have two partitions on my drive, one running 10.9, the other running 10.10 beta. I'm having a hard time figuring out how to make all folders read/write accessible from the other partition. I'd like to be able to access them easily, so that I don't have to change back over to 10.9 every time I want to watch a movie or access one of my files in one of my folders.
All of the info I can find online is totally focused on how to share files between, say, a windows partition and osx partition for example, all the drivers needed etc... and I'm having a hard time just figuring out how to set permissions or whatever is needed to just get those pesky red dots off my folder icons and have them open and available form either partition.
Thanks for any help.
For what it's worth, I've tried hitting "get info" on one of the folders I know I can't get to from the other side (basically, all the main folders in my user except Public), and Everyone has Read Access (I can't even get in for Read at this point from other partition so I'm guessing that's not the right place). My user on the other partition is same username.
Possibly a beta issue with Yosemite, or is there something I'm missing?

This is a screen shot of the shared folder between my 2 partitions (10.6 and 10.9).

Similar Messages

  • How can i share specific applications and files between laptops

    I just bought a McBook Air and I would like to share specific applications and files between my old MacBook Pro and the nw MacBook Air.

    Try target disk mode:
    http://support.apple.com/kb/PH3838
    Other wise use a USB thumb drive or a HDD to transfer them.
    Ciao.

  • Can i share all documents and files on my mac book pro and mac desk top using word

    can i share all documents and files on my mac book pro and mac desk top using word

    Hello, you should be able to if they're running the same version of Word.
    When you log into the Desktop for File Sharing from the MBP, use the Desktop's Username & Desktop's Password, & vice versa if logging into the MBP from the Desktop.

  • Synchinc folders and files between PC an iPhone

    Hi
    I am trying to synchronize a set of folders (grouped by topic, e.g. legal, administration) with files of various types (e.g. xls, doc, pdf, txt, msg, zip, etc.) on our server to my iPhone as an offline reference library.
    However, when I try to add a folder (File -> Add folder) to iTunes, nothing happens.
    What is the best way to synchronize files between server and iPhone / iTunes with keeping the folder structure?
    Thank you

    Thank you.
    This seems to be a good thing. However, not possible for me for legal reasons, since the files would be stored outside the country, and on servers not controlled by the company.

  • Sharing user folders between two OSX partitions

    I have two partitions on my drive running OSX, one running 10.9.4 (we'll call this Partition 1), the other running another recent version of OSX that I apparently can't name here because someone out there doesn't know how to read or is being a troll (you know who you are), and keeps getting my thread deleted for no valid reason. We'll call the second partition, you guessed it, Partition 2.
    What I'd like to be able to do is have my computer booted to Partition 2 and access my user folders (movies, photos, etc) that exist on Partition 1, as it's a drag to have to reboot to Partition 1 every time I want to work, watch a movie, listen to music, etc, etc. etc.
    I've had no luck. No matter what I try, when I'm booted to Partition 2 and try to access the user folders in Partition 1, they all have the red circle on the icon, and I get a "you don't have permission..." error when I try to open them.Helpful facts:
    The username is the same for my user account on both Partition 1 and Partition 2.
    I've tried allowing permissions to everyone, and in Get Info I've tried applying the permission settings to enclosed items (the only suggestion I got on the discussion I started about a month ago on this issue.
    No, I don't have the HD space in my MBPr to have a duplication of the entire user account on the other partition, nor would I want to - if something is modified in Partition 1, I want to have fluid access in Partition 2.
    When in Partition 1, I can move files into the public folder for my Partition 2 user (which I've done a couple times when I know in advance that I might want a file to play with in Partition 2 - though this is nowhere near a practical solution to my issue).
    Thanks for any help.

    You have two different account usernames and passwords, so you cannot access the information in a user account unless you are logged into that account. If you want to access data across the partitions, then both user accounts must have the same username and password. You may then access the information directly or using aliases.
    The alternative to this is to use the entire home folder on one partition as the default home folder on the other partition. You can do this using Users & Groups preferences.
    Open Users & Groups preferences. Click on the lock icon and authenticate. CTRL- or RIGHT-click on your user account listing in the sidebar and select Advanced Options from the context menu. You will see a field labeled "Home dir:" At the right end you will see a Change button. Click on it. In the file dialog locate the Home folder now located on the other partition (HDD/Users/account_name/.) Select the folder, click on Open button. Restart the computer as directed.
    When the computer boots up it will now be using the Home folder located on the other partition.
    I am the person who reported your posts because of the discussion related to beta software. Apparently, you did not like what you were told by the moderators and decided to try again. By insisting on not following the forum rules you were the troll, not I. All you had to do was simply refer to two partitions without regard to what operating systems were involved, etc.
    You have an answer to your question despite your rudeness.

  • Read & Write all folders and files

    How do I allow another account user read & write privileges to all my files and folders? I have set the other user as an administrator however each file and folder that i've copied into their documents folder still need to be changed individually (through the Get Info window) in order to save changes or add new files to them. This is very time consuming, so is there an easier way?

    Not exactly what you are looking for but maybe some useful information:
    http://www.computerworld.com.au/article/197922/useraccounts_file_sharing_leopard_whatnew?pp=1&fp=2&fpid=2

  • How to Unlock all folders and Files in One Main Folder

    How do i unlock all files and folders in one main folder? This way I wouldn't have to do it over 1,000 times to fix my folders I imported from my external drive.

    Open the Script Editor in the /Applications/AppleScript/ folder and enter the following:
    tell application "Finder"
    set locked of every item of entire contents of (selection as alias) to false
    end tell
    Select the main folder in the Finder and run the script.
    (39015)

  • Is there a way to have all folders and files line up all the time by default?

    I was wondering if there was a way to get all files and folders on the desktop and within locations like Downloads and Documents to automatically align to grid by default without user intervention.
    If so, how can I do this?
    Thanks!

    I was wondering if there was a way to get all files and folders on the desktop and within locations like Downloads and Documents
    Mario's post explains, how to arrange in colums in Finder windows.
    You can use the same method to arrange the items on the Desktop:
    Click on the empty Desktop to select it and to bring the Finder forward, press  the key combination ⌘J.
    Select "Snap to Grid" and set the spacing and icon size.
    Select an option how you want to sort them, e.g. by kind.
    Regards
    Léonie

  • How could I remove all folders and files on ../queue/deferred/SMTP-Deliver/* ( This is deferred queue )?

     

    I'm assuming this is Netscape Messaging Server 4.x as your example looks like NMS's queue path and not iMS's.
    You can simpily stop the server, rm all the files under that directory and restart the server.
    When the server starts back up it will scan the queue area and update the control files with what it does (or does not) find the queue area.
    Hope this helps!
    -Chris

  • Can you set up an itunes acount for 3 iphones that wont share all contacts and info between them

    im having trouble understanding itunes adding songs is a pain and when we conect another phone it erases and gives you what the last person had and ther contacts

    On a Windows machine:-
    Hold the shift button down when you double click to open iTunes, it will ask if you want to create a new library, do so for each device you want to sync.
    Hold the shift button down each time you launch iTunes and choose the library you wish to load.
    I am sure someone will come along and fill you in on how to do the same thing on Mac. For the life of me I can not remember
    Jerry

  • Sharing same iTunes library between two OSX partitions

    I have two partitions with an instance of 10.6.6 on each. Is there a way that my iTunes library on one partition can also be used by the other? So if I boot up OSX from the second drive, then I want to be able to access the library on the other partition.

    From one OS, launch iTunes with the Option key held down and point it to the other library. Both installs may need to be running the same iTunes version.
    (57118)

  • Can i share music and photos between two users on the same machine?

    How can I share my music and photos between two users on the same machine?

    Thank you Joe - I tried this but it's only showing a teensy amount of music - the stuff on the second users account as opposed to the giagntic library on the 'main' account. I actually went to a Genius Bar and they said that apple doesn't really want you to share music between accounts - parents don't want to hear their kids music etc. Which seemed strange, but it might be the case sadly   Thanks anyway!

  • Query to get a listing of all folders and joins in EUL

    If anybody has a query that provides a listing of all folders and joins between those folders in a Discoverer EUL, can you please share it.
    Any help would be greatly appreciated.

    Hi
    As Rod commented you won't get an accurate listing going through XREFS. You need to look in the statistics table, EUL5_QPP_STATS where you will find a history of all worksheets that have been executed. Unfortunately the item columns in EUL5_QPP_STATS are encoded so you will need some special SQL to uncode them.
    First of all you will need to have installed the EUL extensions which can be found in the script called EUL5.SQL (located in the Discoverer\Util folder where Admin is installed) when logged in as the owner of the EUL. Theh try running this script, altering the data switch to a suitable date:
    SELECT
    QS.QS_DOC_OWNER    USER_NAME,
    QS.QS_DOC_NAME     WORKBOOK,
    QS.QS_DOC_DETAILS  WORKSHEET,
    TRUNC(QS.QS_CREATED_DATE) EXECUTION_DATE,
    *(LENGTH(TO_CHAR(EUL5_GET_ITEM_NAME(QS.QS_ID)))+1)/9 ITEMS,*
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),1,  6)) ITEM1,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),10, 6)) ITEM2,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),19, 6)) ITEM3,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),28, 6)) ITEM4,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),37, 6)) ITEM5,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),46, 6)) ITEM6,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),55, 6)) ITEM7,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),64, 6)) ITEM8,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),73, 6)) ITEM9,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),82, 6)) ITEM10,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),91, 6)) ITEM11,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),100,6)) ITEM12,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),109,6)) ITEM13,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),118,6)) ITEM14,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),127,6)) ITEM15,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),136,6)) ITEM16,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),145,6)) ITEM17,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),154,6)) ITEM18,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),163,6)) ITEM19,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),172,6)) ITEM20
    FROM
    EUL5_QPP_STATS QS
    WHERE
    *(LENGTH(TO_CHAR(EUL5_GET_ITEM_NAME(QS.QS_ID)))+1)/9 < 21*
    AND QS.QS_CREATED_DATE > '01-JAN-2009'
    Best wishes
    Michael

  • Accessing Windows Drive its folders and files through KM

    Hi All,
    I have portal server installed in my laptop with KM, i would like to access windows C drive with all folders and files in my local machine what are the configurations i have to do.
    One more thing
    In real time scenario can we use CM repository, my requiremtn is to store documents of diffrent king which repository we can use which data base what configurations we have to set, basically what is the difference between internal and external repositories.
    regards,
    Murali

    Hi Murali,
    Internal repositories are those which come created in the KM like etc, documents and many more.
    External repositories are folders on diff locations (either on server or at other system) which are mapped to KM as repositories.
    Now. about ur requirement : You can try mapping the path c:\ as a folder in KM by making a File Repository manager.
    For storing different kind of  documents you can make different folders in Windows and map them as repositories by configuring File Rep managers for them
    See this[ link|http://help.sap.com/saphelp_nw04s/helpdata/en/e3/92322ab24e11d5993800508b6b8b11/frameset.htm]  to know about configuring a file repository manager.
    I hope it helps.
    Regards,
    Sumit

  • Taking Ownership of folders and files

    So I am doing what sure seems like way too much work to do something rather simple in GUI. There seem to be many topics on this and I base my code off of their results, but it isn't working entirely. Hopefully an easy one for you folks!  I am trying
    to take ownership of a path, be it a file or folder.  I DO NOT want to use a separate module like PSCX as not all machines will have the module.
    I created a function based off the code I found at the end of
    http://social.technet.microsoft.com/Forums/en-US/87679d43-04d5-4894-b35b-f37a6f5558cb/ that I can pass a path to singularly or I was hoping to be able to pipe Get-ChildItem to it.  When I do "Get-ChildItem -Path D:\Permissions\TopFolder -Recurse
    -Force | Take-Ownership" it seemed to work, but then I noticed it only seems to work going one layer deep. The text output for troubleshooting shows it recursing all the way through, but yet Owner is not being set all the way down.
    Folder layout:
    D:\Permissions\TopFolder
    D:\Permissions\TopFolder\FirstFolder
    D:\Permissions\TopFolder\FirstFile.txt
    D:\Permissions\TopFolder\FirstFolder\SecondFolder
    D:\Permissions\TopFolder\FirstFolder\SecondFile.txt
    D:\Permissions\TopFolder\FirstFolder\SecondFolder\ThirdFolder
    D:\Permissions\TopFolder\FirstFolder\SecondFolder\ThirdFile.txt
    Function Take-Ownership {
    [CmdletBinding(DefaultParameterSetName=”Set01”)]
    Param(
    [parameter(Mandatory=$true,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True,Position=1,ParameterSetName='Set01')]
    [string]$Path,
    [parameter(Mandatory=$true,ValueFromPipelinebyPropertyName=$True,ParameterSetName='Set02')]
    [Alias('FullName')][string]$FullPath
    ) # End of Param()
    Begin {
    # Check that script was Run as Administrator
    If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
    [Security.Principal.WindowsBuiltInRole] "Administrator")) {
    Write-Host -ForegroundColor Red -BackgroundColor Black "`n ERROR: You MUST have Administrator rights to run this script!"
    Write-Host -ForegroundColor Red -BackgroundColor Black " Re-run this script as an Administrator!`n"
    Break
    #P/Invoke'd C# code to enable required privileges to take ownership and make changes when NTFS permissions are lacking
    $AdjustTokenPrivileges = @"
    using System;
    using System.Runtime.InteropServices;
    public class TokenManipulator
    [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
    internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall,
    ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr relen);
    [DllImport("kernel32.dll", ExactSpelling = true)]
    internal static extern IntPtr GetCurrentProcess();
    [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
    internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr
    phtok);
    [DllImport("advapi32.dll", SetLastError = true)]
    internal static extern bool LookupPrivilegeValue(string host, string name,
    ref long pluid);
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    internal struct TokPriv1Luid
    public int Count;
    public long Luid;
    public int Attr;
    internal const int SE_PRIVILEGE_DISABLED = 0x00000000;
    internal const int SE_PRIVILEGE_ENABLED = 0x00000002;
    internal const int TOKEN_QUERY = 0x00000008;
    internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;
    public static bool AddPrivilege(string privilege)
    try
    bool retVal;
    TokPriv1Luid tp;
    IntPtr hproc = GetCurrentProcess();
    IntPtr htok = IntPtr.Zero;
    retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);
    tp.Count = 1;
    tp.Luid = 0;
    tp.Attr = SE_PRIVILEGE_ENABLED;
    retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid);
    retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero);
    return retVal;
    catch (Exception ex)
    throw ex;
    public static bool RemovePrivilege(string privilege)
    try
    bool retVal;
    TokPriv1Luid tp;
    IntPtr hproc = GetCurrentProcess();
    IntPtr htok = IntPtr.Zero;
    retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);
    tp.Count = 1;
    tp.Luid = 0;
    tp.Attr = SE_PRIVILEGE_DISABLED;
    retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid);
    retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero);
    return retVal;
    catch (Exception ex)
    throw ex;
    Add-Type $AdjustTokenPrivileges
    # Activate necessary admin privileges to make changes without NTFS perms on the folder
    [void][TokenManipulator]::AddPrivilege("SeRestorePrivilege") # Necessary to set Owner Permissions
    [void][TokenManipulator]::AddPrivilege("SeBackupPrivilege") # Necessary to bypass Traverse Checking
    [void][TokenManipulator]::AddPrivilege("SeTakeOwnershipPrivilege") # Necessary to override File Permissions
    $Admin = New-Object System.Security.Principal.NTAccount("BUILTIN\Administrators")
    $NewDirACL = New-Object System.Security.AccessControl.DirectorySecurity
    $NewFileACL = New-Object System.Security.AccessControl.FileSecurity
    $NewDirACL.SetOwner($Admin)
    $NewFileACL.SetOwner($Admin)
    } # End of Begin {}
    Process {
    if( $FullPath.Length -gt 0 ) {
    if( Test-Path $FullPath ) {
    $Path = $FullPath
    if( Test-Path $Path -PathType Container ) {
    "Take Ownership: $Path"
    $Folder = Get-Item $Path -Force
    $Folder.SetAccessControl($NewDirACL)
    } elseif( Test-Path $Path -PathType Leaf ) {
    "Take Ownership: $Path"
    $File = Get-Item $Path -Force
    $File.SetAccessControl($NewFileACL)
    } else {
    Write-Host -ForegroundColor Red -BackgroundColor Black "ERROR: Path does not exist: $Path"
    } # End of Process {}
    End { } # End of End {}
    } # End of Function Take-Ownership
    To run this I have been doing:
    PS D:\> $Folder = 'D:\Permissions\TopFolder'
    PS D:\> Get-Item $Folder | Get-Acl
    Directory: D:\Permissions
    Path Owner
    TopFolder DOMAIN\user1
    PS D:\> Get-ChildItem $Folder -Force -Recurse | Get-Acl
    Directory: D:\Permissions\TopFolder
    Path Owner
    FirstFolder DOMAIN\user1
    FirstFile.txt DOMAIN\user1
    Directory: D:\Permissions\TopFolder\FirstFolder
    Path Owner
    SecondFolder DOMAIN\user1
    SecondFile.txt DOMAIN\user1
    Directory: D:\Permissions\TopFolder\FirstFolder\SecondFolder
    Path Owner
    ThirdFolder DOMAIN\user1
    ThirdFile.txt DOMAIN\user1
    PS D:\>
    PS D:\> Get-Item $Folder | Take-Ownership
    Take Ownership: D:\Permissions\TopFolder
    PS D:\> Get-ChildItem $Folder -Force -Recurse | Take-Ownership
    Take Ownership: D:\Permissions\TopFolder\FirstFolder
    Take Ownership: D:\Permissions\TopFolder\FirstFile.txt
    Take Ownership: D:\Permissions\TopFolder\FirstFolder\SecondFolder
    Take Ownership: D:\Permissions\TopFolder\FirstFolder\SecondFile.txt
    Take Ownership: D:\Permissions\TopFolder\FirstFolder\SecondFolder\ThirdFolder
    Take Ownership: D:\Permissions\TopFolder\FirstFolder\SecondFolder\ThirdFile.txt
    PS D:\>
    PS D:\>
    PS D:\> Get-Item $Folder | Get-Acl
    Directory: D:\Permissions
    Path Owner
    TopFolder BUILTIN\Administrators
    PS D:\> Get-ChildItem $Folder -Force -Recurse | Get-Acl
    Directory: D:\Permissions\TopFolder
    Path Owner
    FirstFolder BUILTIN\Administrators
    FirstFile.txt BUILTIN\Administrators
    Directory: D:\Permissions\TopFolder\FirstFolder
    Path Owner
    SecondFolder DOMAIN\user1
    SecondFile.txt DOMAIN\user1
    Directory: D:\Permissions\TopFolder\FirstFolder\SecondFolder
    Path Owner
    ThirdFolder DOMAIN\user1
    ThirdFile.txt DOMAIN\user1
    PS D:\>
    I don't know why this isn't working.  The output text shows I went through the subfolders and files...HELP!
    Find this post helpful? Does this post answer your question? Be sure to mark it appropriately to help others find answers to their searches.

    Here is the end result. I am looking to add a '-Recurse'/'-Force' switches to give another option to not have to Get-ChildItem and pipe it to the function and possibly a '-User' parameter to be able to specify who to set as owner, but both of those ideas
    are untested.
    Here is the code.  Hope it helps someone else.
    Function Take-Ownership {
    <#
    .SYNOPSIS
    This function takes ownership of a file or folder and sets it back to 'BUILTIN\Administrators'.
    .DESCRIPTION
    This function takes ownership of a file or folder and sets it back to 'BUILTIN\Administrators'.
    This will work even when the user does not have ownership or existing permissions on the file or folder.
    .EXAMPLE
    PS C:\> Take-Ownership -Path $Path
    Takes ownership of the individual folder or file. The -Path is optional as long as $Path
    is the first parameter.
    .EXAMPLE
    PS C:\> Get-Item $Path | Take-Ownership
    Takes ownership of the individual folder or file.
    .EXAMPLE
    PS C:\> Get-ChildItem $Path -Recurse -Force | Take-Ownership
    Recurse through all folders and files, including hidden, and takes ownership.
    #>
    [CmdletBinding()]
    Param(
    [parameter(Mandatory = $true, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True, Position = 0)]
    [Alias('FullName')]
    [string]$Path
    ) # End of Param()
    Begin {
    # Check that script was Run as Administrator
    If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
    [Security.Principal.WindowsBuiltInRole] "Administrator")) {
    Write-Host -ForegroundColor Red -BackgroundColor Black "`n ERROR: You MUST have Administrator rights to run this script!"
    Write-Host -ForegroundColor Red -BackgroundColor Black " Re-run this script as an Administrator!`n"
    Return
    #P/Invoke'd C# code to enable required privileges to take ownership and make changes when NTFS permissions are lacking
    $AdjustTokenPrivileges = @"
    using System;
    using System.Runtime.InteropServices;
    public class TokenManipulator
    [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
    internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall,
    ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr relen);
    [DllImport("kernel32.dll", ExactSpelling = true)]
    internal static extern IntPtr GetCurrentProcess();
    [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
    internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr
    phtok);
    [DllImport("advapi32.dll", SetLastError = true)]
    internal static extern bool LookupPrivilegeValue(string host, string name,
    ref long pluid);
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    internal struct TokPriv1Luid
    public int Count;
    public long Luid;
    public int Attr;
    internal const int SE_PRIVILEGE_DISABLED = 0x00000000;
    internal const int SE_PRIVILEGE_ENABLED = 0x00000002;
    internal const int TOKEN_QUERY = 0x00000008;
    internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;
    public static bool AddPrivilege(string privilege)
    try
    bool retVal;
    TokPriv1Luid tp;
    IntPtr hproc = GetCurrentProcess();
    IntPtr htok = IntPtr.Zero;
    retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);
    tp.Count = 1;
    tp.Luid = 0;
    tp.Attr = SE_PRIVILEGE_ENABLED;
    retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid);
    retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero);
    return retVal;
    catch (Exception ex)
    throw ex;
    public static bool RemovePrivilege(string privilege)
    try
    bool retVal;
    TokPriv1Luid tp;
    IntPtr hproc = GetCurrentProcess();
    IntPtr htok = IntPtr.Zero;
    retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);
    tp.Count = 1;
    tp.Luid = 0;
    tp.Attr = SE_PRIVILEGE_DISABLED;
    retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid);
    retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero);
    return retVal;
    catch (Exception ex)
    throw ex;
    Add-Type $AdjustTokenPrivileges
    # Activate necessary admin privileges to make changes without NTFS perms on the folder
    [void][TokenManipulator]::AddPrivilege("SeRestorePrivilege") # Necessary to set Owner Permissions
    [void][TokenManipulator]::AddPrivilege("SeBackupPrivilege") # Necessary to bypass Traverse Checking
    [void][TokenManipulator]::AddPrivilege("SeTakeOwnershipPrivilege") # Necessary to override File Permissions
    } # End of Begin {}
    Process {
    # Process for taking Ownership of the folder
    # - Specify the NT Account user to set as Owner (BUILTIN\Administrators)
    # - Create a new ACL object for the sole purpose of defining a new owner
    # - Establish the new ACL as owned by BUILTIN\Administrators, thus
    # guaranteeing the following ACL changes can be applied.
    # - Then apply that update to the existing folder's ACL which merges
    # the proposed changes (new owner) into the folder's actual ACL
    # - - IN OUR CASE OVERWRITING THE OWNER
    # - Additional Documentation:
    # http://msdn.microsoft.com/en-us/library/System.Security.AccessControl(v=vs.110).aspx
    $Admin = New-Object System.Security.Principal.NTAccount("BUILTIN\Administrators")
    $NewDirACL = New-Object System.Security.AccessControl.DirectorySecurity
    $NewFileACL = New-Object System.Security.AccessControl.FileSecurity
    $NewDirACL.SetOwner($Admin)
    $NewFileACL.SetOwner($Admin)
    if( Test-Path $Path -PathType Container ) {
    $Folder = Get-Item $Path -Force
    $Folder.SetAccessControl($NewDirACL)
    } elseif( Test-Path $Path -PathType Leaf ) {
    $File = Get-Item $Path -Force
    $File.SetAccessControl($NewFileACL)
    } else {
    Write-Host -ForegroundColor Red -BackgroundColor Black "ERROR: Path does not exist: $Path"
    } # End of Process {}
    End { } # End of End {}
    } # End of Function Take-Ownership
    Find this post helpful? Does this post answer your question? Be sure to mark it appropriately to help others find answers to their searches.

Maybe you are looking for

  • Trying to install VM Server and not getting the CD found screen to display

    Trying to install Oracle VM Server from a CDROM: 1.     Insert the Oracle VM Server CDROM into your CDROM drive. 2.     Boot the computer with the Oracle VM Server CDROM. 3.     The Oracle VM Server screen is displayed. All that went fine but not get

  • Duplicate Physical Tables

    Hi, I am trying to import two physical tables in the repository, both tables are the same as I would like to do a self join amongst the two tables and a fact table. I am finding that I am only able to view data from one table imported, I am then copy

  • How to register a form in applications

    I am trying to customise the Template form. Once this is done, how do I register the customised form in applications.....

  • What are tables in Inventory Management in SAP-MM

    Hi all, i would like to know the nemes of tables in SAP-MM Inventory Management. Plz provide me ur help. Thanks.... Bandhan

  • Service module placement and the L2 adjacency problem

    I'd be very interested to hear others opinions on this. You have a datacenter environment with L2 boundaries at end of row aggregators, then L3 back to the core and edge. You have 6500 service module switches hanging off the core housing ACE and FWSM