Trying to change – to . in users phone numbers

We have no consistency in our AD, and want to set a standard for the way users phone numbers are configured.

right now its 123-123-1234, (123) 123-1234, 123/123-1234, etc

we want them all to be 123.123.1234

i am trying to wrap my head around the logic on the best way to script this.

Right now my plan is the following

$OfficePhone = (Get-ADUser -Identity user-Properties OfficePhone).OfficePhone $OfficePhone = $OfficePhone -replace ‘-‘,’.’ And then set the variable back to OfficePhone

is that the best way?

submitted by /u/pbyyc
[link] [comments]

Leave a Reply