pjenroute's recent activity

  1. Comment on PowersHell and graph - setting SharePoint folder permissions help in ~comp

    pjenroute
    Link Parent
    hello there, first, thank you very much! I am the other person wrapped up in this silliness. You pointed me in the correct direction. The situation was wanting to use graph and powershell to...

    hello there, first, thank you very much! I am the other person wrapped up in this silliness.
    You pointed me in the correct direction.
    The situation was wanting to use graph and powershell to create a folder structure and then block permissions on certain folders.
    The key was in the Add Permissions link you sent.
    I'm using the Invoke-MgInviteDriveItem module and found setting the retainInheritedPermissions parameter false removes all existing permissions "when sharing for the first time". I found this only works though if i set the sendInvitation parameter to true. Since the "owner" of the team is who i want to be able to see the hidden folders, it works out to be easier and i decided i dont mind if they get a message saying it's there and only for you.
    I basically build the payload based on the link you sent:
    $parms = @{
    recipients = @(
    @{
    email = "$TeamOwnerEmail"
    }
    )
    message = "Verbiage Verbiage Verbiage "
    requireSignIn = $true
    sendInvitation = $true
    retainInheritedPermissions = $false
    roles = @(
    "write"
    )
    }
    then i push those parms as the -BodyParameter using Invoke-MgInviteDriveItem along with the -DriveId and -DriveItemId

    Again, super grateful for the help. Thanks so much

    1 vote