Oct 29 2021 06:00 AM
Hello I am trying to get this script to update a list of samaccountname from lowercase to uppercase. We have an application that has issues with lowercase. I have tried the below and it is giving me a "You cannot call a method on a null-valued expression" error when running. I am not sure what I am doing wrong but any help will be greatly appreciated. Here is the script I am using now.
$users = get-content '.\users.txt'
foreach($user in $users){
set-aduser $user -SamAccountName $user.samaccountname.toupper()
}
Oct 29 2021 08:29 AM
Oct 29 2021 08:49 AM
Oct 29 2021 08:55 AM
SolutionOct 29 2021 09:51 AM
Oct 29 2021 08:55 AM
Solution