How to select values from curly brackets?

Welcome Forums General PowerShell Q&A How to select values from curly brackets?

Viewing 2 reply threads
  • Author
    Posts
    • #209502
      Participant
      Topics: 4
      Replies: 7
      Points: 27
      Rank: Member

      The command Get-AzureADAuditDirectoryLogs -Filter "initiatedBy/app/displayName eq 'Skype For Business Powershell Server Application'" | select targetresources, activitydatetime | FL  gives me this output

      TargetResources : {class TargetResource {
      Id: bfa9ddfa-e22e-4227-914b-f73781f22026
      DisplayName:
      Type: User
      UserPrincipalName: John.Smith@company.com
      GroupType:
      ModifiedProperties: class ModifiedProperties {
      }

      }
      }
      ActivityDateTime : 9. 2. 2020 17:46:34

      How can I select only userPrincipalName from this class? Thanks

    • #209517
      Participant
      Topics: 5
      Replies: 328
      Points: 522
      Helping Hand
      Rank: Major Contributor
    • #209595
      Participant
      Topics: 4
      Replies: 7
      Points: 27
      Rank: Member

      thanks but when I use this command the output is empty

      PS C:\WINDOWS\system32> (Get-AzureADAuditDirectoryLogs -Filter "initiatedBy/app/displayName eq 'Skype For Business Powershell Server Application'" |
      select targetresources).UserPrincipalName

      PS C:\WINDOWS\system32>

Viewing 2 reply threads
  • The topic ‘How to select values from curly brackets?’ is closed to new replies.