When we create the new Active Directory we add the user to it, right? No brainer.

So, when we want to achieve this via automation say PowerShell script, it’s almost straightforward to add or create a new user in Active Directory.

But how to check programmatically if the use is added correctly or not? OR in another scenario, if want to check if the particular user is present in Active Directory or not?

So below PowerShell does the same job.