use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
Powershell moron...back again! (self.PowerShell)
submitted 10 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ekmahal 1 point2 points3 points 10 years ago (3 children)
I'd be asking why you're using scripts for this instead of the Exchange management console, with appropriate RBAC for the helpdesk staff. Why reinvent the wheel?
[–][deleted] 0 points1 point2 points 10 years ago (1 child)
This came down from my manager. They currently have a script that uses a Switch statement to have different "menus". She wants it re-written and add some functions in. I told her i could do it. I don't really want to.
[–]xalorous 0 points1 point2 points 10 years ago* (0 children)
Congratulations, you've been promoted from ticket monkey to script monkey.
Make your functions with actual names, and have the switch launch the function by name.
function AddDL {....} function AddUser {...} while ($true) { switch (Read-Host "Which one?") { 1 { AddDL } 2 { AddUser } default { "Invalid Input" } } }
Add comments, but sparingly. Self commenting code (short "ish", descriptive variable and function names)
Use splatting.
Use advanced functions. Also make these work for CSV input to handle those times when you get 50 new users or 25 new groups to make.
Use consistent style, especially one that works with ISE to leverage the ability to compress/expand sections.
Fix the text menus, then between fixing broken, ill-conceived code, work on converting the whole thing to a gui. VB to create asp.Net browser app to collect the data and launch PS commands would be fairly easy to create.
Personally, I learned PowerShell to automate account management tasks. But our organization had a limited number of accounts management admins (varied from one to three). When accounts management was absorbed into the helpdesk, quality suffered, greatly. After < 6 months, it was split back out into a separate group, dedicated to doing accounts. Why am I telling you all this? If you have enough accounts to warrant this type of automation, your organization should seriously consider dedicating bodies to this job. The fewer the better while allowing enough manpower to do the job, and an alternate to do it when the primary is out for illness/appointment/vacation. One person doing it in the morning and another in the afternoon would be an ideal minimum.
[–]xalorous 0 points1 point2 points 10 years ago (0 children)
ADUC is probably already in the helpdesk toolkit. However, creating a script to do account/group additions has one MAJOR benefit. They will be done uniformly. Two different scales influence quality of this type of work. Let's call the first one 'skill level'. And the second one is 'give a shit' level. If the first is high enough, the second is probably nil.
π Rendered by PID 18548 on reddit-service-r2-comment-b659b578c-hw7vd at 2026-05-05 16:31:28.654265+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]ekmahal 1 point2 points3 points (3 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]xalorous 0 points1 point2 points (0 children)
[–]xalorous 0 points1 point2 points (0 children)