Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Set-ADUser to modify givenname and surname attributes based upon displayname in powershell

$
0
0
Hello to everyone,

i'm trying to restore AD Users records to a proper shape.

More in details,current AD users records contains only the displayname and the other mandatory attributes,everything is lacking (like givenname,surname,telephonenumber,address,city,country ecc. ecc.)

Actuallly,i'm trying to achieve three results:

1 - Populate at least the Givenname and Surname from the displayname attribute (since this one is "name-space-surname")

2 - Populate the address,country,city based on the OU's membership

3 - populate the phonenumber attribute from a csv that i'm trying to build from mixing various others excel files

I need help for the first one.

An example of a displayname that i have is like:

"test1 Test2"

What i'm trying to do is to extract "test1"and assign as "Givenname" and extract "test2" and assign it as "surname"

How can i use Set-aduser to achieve what i want?

Thanks for any reply



Viewing all articles
Browse latest Browse all 21975

Trending Articles