I want to remove the suffix from an import-csv UPN
But i keep getting that the value is null.
$ADUsers = Import-Csv C:\temp\guid.csv -Delimiter ";"
ForEach ($User in $ADUsers) {
%{$User.UserPrincipalName.Split('@')[0]}
}
I want to remove the suffix from an import-csv UPN
But i keep getting that the value is null.
$ADUsers = Import-Csv C:\temp\guid.csv -Delimiter ";"
ForEach ($User in $ADUsers) {
%{$User.UserPrincipalName.Split('@')[0]}
}
Have you verified that the CSV contains a column named "UserPrincipalName"?
Hi,
Is the value of $ADUsers.UserPrincipalName null? If so, please check the header and the delimiter of the CSV file.
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
11 people are following this question.