79205181

Date: 2024-11-19 22:05:40
Score: 1
Natty:
Report link

After a lot of seraching I finally found what I needed.

        $ItemID = $Listitem.Id
        $ListitemConnection = Get-MgSiteListItem -SiteId $siteId -ListId $listId -ListItemId $ItemId -ExpandProperty "fields" -Property *
        $ListitemDetails = $ListitemConnection.Fields.AdditionalProperties
        $BuyerID = $ListitemDetails.BuyerLookupId
        # Get the User Information List
        $UserList = Get-MgSiteList -SiteId $SiteID -Filter "DisplayName eq 'User Information List'" -Select Id
        # Get the user details using the LookupId
        $User = Get-MgSiteListItem -SiteId $SiteID -ListId $UserList.Id -ListItemId $BuyerID -Select "fields" -ExpandProperty "fields"
        # Extract the email address
        $BuyerEmail = $User.Fields.AdditionalProperties.UserName
Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Mark D. MacLachlan