Quantcast
Channel: Directory Services forum
Viewing all articles
Browse latest Browse all 31638

update samaccountname and upn based on email

$
0
0

HI Expert,

I really need your help.

we are using windows server 2016, and our AD users' Samaccountname and UPN are not the same as their email address. Now We'd like to bulk edit users' samaccount name and upn based on users' email address using the following CSV file.

this table describe the current situation

sAMAccountName

UserPrincipalName

Emailaddress

LMing

LM@domain.com

Li.Ming@domain.com

WYi

WY@domain.com

Wang.Yi@domain.com

HJiu

HJ@domain.com

He.Jiu@domain.com

the following is what I want to achieve

sAMAccountName

UserPrincipalName

Emailaddress

Li.Ming

Li.Ming@domain.com

Li.Ming@domain.com

Wang.Yi

Wang.Yi@domain.com

Wang.Yi@domain.com

He.Jiu

He.Jiu@domain.com

He.Jiu@domain.com

Because I am very new to powershell and script. Anyone has suggestions are highly appreciated .

Regards,

jianggai


Viewing all articles
Browse latest Browse all 31638

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>