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!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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!
foo: this worked perfectly, thank you.
You both have such beautiful minds! Thank you again for your assistance. EE blows me away every time!
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
450 to Correct answer provided by foo
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.