|
This will do what you want (untested):code:
Here is a page on loops in powershell that I used to recall syntax. It should give you an idea of what's possible. You're probably going to use foreach more than any other loop structure in system admin. To add the logging functionality just tack an echo statement or whatever you prefer in that loop. $i is a Directory object that you can do all sorts of fun things with. Dessert Rose fucked around with this message at 21:08 on Mar 31, 2010 |
# ¿ Mar 31, 2010 21:05 |
|
|
# ¿ Apr 28, 2024 16:53 |
|
adaz posted:LDAP properties & names are the same with powershell as vbscript. I don't know if it actually works if you spell it right, but I'm sure it won't work if you spell it wrong.
|
# ¿ May 13, 2010 05:39 |
|
I'm trying to replace some text in a file, and Powershell is thwarting my attempts to make it useful. Basically I have a .prf exported from the Office Customization Tool, and I want to replace the account name with whatever the user puts in. According to everyone on the internet, I want to do some variant of: code:
In the case of the above code, it destroys line endings horribly. I also tried: code:
Powershell can't be this incompetent at working with text files. What am I missing? I'm about to punt and just do it with C#.
|
# ¿ Oct 27, 2010 02:01 |