none
Find ManagedObjects from user RRS feed

  • Question

  • Hi All

    I am trying to find if a particular user is owns any Distribution list as part of the managed objects. I was able to get the list of the DL's the user owns but I am getting the DL with the Distinguished name and i am unable to select only the Distribution List Display Name.

    $Managedgrp = Get-ADUser -Identity 'Samaccountname' -Properties managedObjects
    Write-Host $Managedgrp
    $Groups = $Managedgrp.managedObjects -split(',') | Select-String -Pattern "CN=\"
    Write-Host $Groups

    I am unable to get the string which starts with CN=\ and I want to trim these characters to get the display name of the DL


    Justin

    Saturday, November 10, 2018 4:09 AM

Answers

  • Get-ADUser -Identity Samaccountname -Properties managedObjects |
        select -ExpandProperty managedObjects |
        Get-AdObject |
        select Name
    


    \_(ツ)_/

    • Marked as answer by JS2206 Wednesday, November 14, 2018 11:31 AM
    Saturday, November 10, 2018 4:19 AM

All replies

  • Get-ADUser -Identity Samaccountname -Properties managedObjects |
        select -ExpandProperty managedObjects |
        Get-AdObject |
        select Name
    


    \_(ツ)_/

    • Marked as answer by JS2206 Wednesday, November 14, 2018 11:31 AM
    Saturday, November 10, 2018 4:19 AM
  • Thank you so much

    Justin

    Wednesday, November 14, 2018 11:32 AM