Azure AD – Hybrid Device Join (HDJ) Status – Pending

Nice Article

Sam's Corner

This is a second blog post in a row about AAD Connect and Hybrid Device Join aka HDJ which explains that I haven’t played with it lately (latest entry in here). I visited one of my customer sites last week and during the day I found that there was a high number of failed sign-ins against Azure AD. I was a bit curious about what’s causing those ones, let’s see what I found.

The Problem

From the internal network, Hybrid Device Join (HDJ) registration was not working as expected in some of the devices and a high number of failed sign-ins events were found from Azure AD sign-in logs. I noticed that my own identity was having 3-4 failed sing-ins multiple times per day on a regular basis. Even, end-users didn’t have a critical problem it’s definitely something that needs to be fixed to make sign-in process much…

View original post 469 more words

Dynamic Distribution List members


Lets have a look how to retrieve dynamic distribution list members.

First Connect to Exchange on premise or Exchange online PowerShell

$dynamic = Get-DynamicDistributionGroup -Identity

Get-Recipient -RecipientPreviewFilter $dynamic.RecipientFilter

Above command will provide you samaccountname list from that dynamic list. If you need email address then add few attributes to second command.

Get-Recipient -RecipientPreviewFilter $dynamic.RecipientFilter | ft PrimarySmtpAddress

If you want to export this to an excel sheet, add another command using pipe.

Get-Recipient -RecipientPreviewFilter $dynamic.RecipientFilter | ft PrimarySmtpAddress | export-csv c:\temp\dynamic.csv

PnP PowerShell does not show all the fields in its output.

Something I want to share that i recently found regarding PnP PowerShell.

Sometime PnP powershell does not show all the fields though you have added those fields to your script. Below can be one of the reason.

I was writing a script to pull information from SharePoint list. For some reason DisplayName field was not showing any output.

Below is the sample script.

$username = “
$password = “xxxx”
$UserCredential = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(convertto-securestring $Password -asplaintext -force)
Connect-PnPOnline -Url “” -Credentials $UserCredential

$listItems= Get-PnPListItem -List UserList

foreach($listItem in $listitems){
Write-Host “Employeenumber” : $listItem[“Title”]
Write-Host “FirstName” : $listItem[“FirstName”]
Write-Host “LastName” : $listItem[“LastName”]
Write-Host “DisplayName” : $listItem[“DisplayName”]
Write-Host “sam” : $listItem[“sam”]
Write-Host “title” : $listItem[“Designation”]
Write-Host “manager” : $listItem[“manager”]
Write-Host “Department” : $listItem[“Department”]
Write-Host “Office” : $listItem[“Office”]
Write-Host “Co” : $listItem[“Co”]
Write-Host “upn” : $listItem[“upn”]

I could view all the fields except Displayname. After that i came to know about PnPView. This powershell will not show you output of your script but it will show you properties being used in the list.

See below.

In above you can properties called “ListViewXML’.

This will provide you fields that are being used by SharePoint in your list. If you see DisplayName parameter is already being used by SharePoint List to capture some other data. Hence It was not showing my own field from the list.

This PowerShell cmdlet will help you to find out such fields being used by List and then you can change the name of your field to get the desired result.

Hope this will help others. Leave a comment if you like my post.

Create your website with
Get started