Get the App
SLTechnology News&Howtos  ›  Servers  › 

Find the account of the pager number in the CSV form in batch and export his pager and UserPrincipalName

Shulou Source: shulou.com Published: 2022-06-02 19:27:23 10月03日 Update

# Author:Young, when: January 2018

# Email:azhe.911@foxmail.combr/ > # Author:Young, when: January 2018

# Email:azhe.911@foxmail.com

# Version:1.2

#

Import-Module ActiveDirectory

Import-Module-Name ActiveDirectory

Add-PSSnapin Microsoft.Exchange*

$ADUser=gc C:\ Users\ yuanzhe\ Desktop\ pager.csv

Foreach ($Users in $ADUser)

{

# plug select the account pager and UserPrincipalName attributes corresponding to the pager number in my table, and import the results into pagers.csv

Get-ADUser-Filter {pager-eq $Users}-Properties pager,UserPrincipalName | select pager,UserPrincipalName | Export-Csv-Append-NoTypeInformation-Encoding UTF8-Path pagers.csv

}

Tags: Time number pager account two attributes result select and will form Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Apple MariaDB Shulou Information Xiaomi