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: 3
      Replies: 7
      Points: 14
      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: 321
      Points: 436
      Helping Hand
      Rank: Contributor
      (Get-AzureADAuditDirectoryLogs -Filter "initiatedBy/app/displayName eq 'Skype For Business Powershell Server Application'" | 
      select targetresources).UserPrincipalName
      
    • #209595
      Participant
      Topics: 3
      Replies: 7
      Points: 14
      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
  • You must be logged in to reply to this topic.