ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    PowerShell: Public Folder Search / remove

    Scheduled Pinned Locked Moved IT Discussion
    pspowershelloffice365office 365distrodistribution groupsaddremove
    3 Posts 2 Posters 776 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • gjacobseG
      gjacobse
      last edited by

      I have this script to SEARCH the public folders for a user

      $user = Read-Host "Enter an Exchange identity:  first.last"
      $distgroup = Get-DistributionGroup
      foreach ( $distgroup in $distgroup ) {
      
      $distmember = Get-DistributionGroupMember -Identity $($distgroup.identity) | where {$_.identity -eq "$user"}
      
          if ( $distmember -ne $null ) {
         Write-Host "$user is in $($distgroup.DisplayName)"
          }
      }
      Write-host "Search complete!"
      

      However, the next step is to remove that person from those public folders.

      I expect it's rather simple task,.. but the searches I have done, haven't found anything.

      1 Reply Last reply Reply Quote 0
      • gjacobseG
        gjacobse
        last edited by

        Is this what I am looking for?

        Remove-PublicFolderClientPermission -Identity "\My Public Folder" -User Contoso\Chris
        
        black3dynamiteB 1 Reply Last reply Reply Quote 0
        • black3dynamiteB
          black3dynamite @gjacobse
          last edited by

          @gjacobse said in PowerShell: Public Folder Search / remove:

          Is this what I am looking for?

          Remove-PublicFolderClientPermission -Identity "\My Public Folder" -User Contoso\Chris
          

          Looks correct to me.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post