The Active Directory Attribute 'otherHomePhone' is used as an employee ID which can contain leading zeros. It seems the leading zero's get truncated. For example: If the employee ID is 003421, the output file has 3421. Any suggestions?
import-module activedirectory
Get-ADUser -Filter {(ObjectClass -eq "user")} -Properties Mail,otherHomePhone |
Select-Object GivenName,Surname,userPrincipalName,mail,@{n="otherHomePhone";e={$_.otherHomePhone[0]}} |
Export-Csv -NoType "jper263a.csv"
Copy-Item d:\Scripts\PeopleSoftADExport\jper263a.csv \\addfsdev01\bjsdev\VOL1\ADexport
http://techwithmike.com