User Tools

Site Tools


en:powershell:advanced

This is an old revision of the document!


PowerShell

Advanced

From basics, we know how to:

  • read CSV file
  • write CSV file with new columns
  • test email format from one column

Now let's discover how to query one Active Directory. First one new PowerShell module is required to deal with AD.

# once per server
Install-Module ActiveDirectory

Let's start from the same input we managed into basics part.

SamaccountnameMail
abc123abc123@domain.com
def123def123@domain.com
ghi123ghi123@test.com
input.csv
Samaccountname,Mail
abc123,abc123@domain.com
def123,def123@domain.com
ghi123,ghi123@test.com

Before we tested mail addresses in an easy way : does it end with “domain.com” ?. New tests with AD queries, Samaccountname must belong to an active user from AD and AD user mail must be equal to mail from CSV file.

en/powershell/advanced.1615853921.txt.gz · Last modified: 2021/03/15 20:18 by lonclegr