Link to home
Start Free TrialLog in
Avatar of Irrylyn
Irrylyn

asked on

Replace character in AD description for all computer accounts

Good morning experts!

I am looking for a script (ps prefered) that will replace a character in computer accounts description in a particular OU.

Under MYCompany OU:

If ':' exists, replace it with '.'
and
If '/' exists, replace it with '.'
and
If '(' exists, replace it with ' ' (space)
and
If ')' exists, replace it with ' ' (space)


We have added many descriptions over the years that include these types of characters, but now are running some ps scripts that these characters seem to interfere with.  Periods seem safe, so we'd like to do a mass replace of all of the problem characters to replace them with either periods or spaces.

Your help is appreciated, as always!
SOLUTION
Avatar of becraig
becraig
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good catch Foo - I really did not read this was for description.

Irrylyn go ahead and ignore my post, I wrote something for a rename of the computer in AD and missed the word "description" too early in the morning without my coffee.
Avatar of Irrylyn
Irrylyn

ASKER

No worries, craig.  I caught that before I used it (I was lucky enough to have my coffee this morning!)  but it may very well come in handy at another time!

foo:  this worked perfectly, thank you.

You both have such beautiful minds!  Thank you again for your assistance.  EE blows me away every time!
Avatar of Irrylyn

ASKER

50 to craig for the work put into that script which I am sure I will need at some point.

450 to Correct answer provided by foo