Category: PowerShell
-
PowerShell code to split a space delimited string – with double spaces
I am working on a PowerShell wrapper script to run multiple commands on multiple machines. The first thing I wanted to do was to chop up a space or comma delimited argument. (If you make an argument mandatory, and the user does not provide it, PowerShell will prompt you for it – and when prompted…
-
PowerShell wrapper scripts to find locked accounts and prompt to unlock
I wanted a quick way to find if an account is locked out (you get the call “I can’t log in”) and unlock it. I had a wrapper script that just called “Search-ADAccount –LockedOut” but I took it a bit further. The first of these two wrapper scripts/functions gets all the accounts that are locked…
-
Start Visual Studio form PowerShell
I am moving on to a new project – our migration from SharePoint 2007 to 2010. First thing I wanted to do was to upgrade my Solutions/Features from 2007 to 2010. I installed Visual Studio and started looking at how to recreate my Delegate JQuery Control (more on that later). The first thing I found annoying…
-
PowerShell wrapper script to send email
I wanted a standard function that I can call from other scripts to send email. I needed multiple recipients, and default sender and smtp arguments. Here is the script that I came up with.
-
PowerShell script to add users to a group
In this previous post : PowerShell wrapper for creating a new distribution group, I created a script for creating a new distribution group. I wanted to take that a step further and prompt the SysAdmin to add users. I created a new recursive function called AddToDistributionGroup. In this code, I prompt for a group name, and…
-
PowerShell wrapper for creating a new distribution group
Unknown to me, in Exchange 2010 when you create a new distribution group in EMC, by default, the group will not receive email from external recipients – the setting “Require that senders are authenticated” is checked. We use distribution groups to communicate with clients, so unauthenticated senders need to email these groups. This setting is…
-
PowerShell wrapper scripts for Exchange 2010 – first step: make a connection
As I talked about in this previous post, I like to write wrapper scripts that collect input and pass it along to the actual provided functions. I call these wrapper scripts because they are not really doing anything ground breaking, they are just a series of conditionals and commands that I put together, with a…
-
PowerShell script to email users if password expires soon, and send a summary to IT
I wanted to expand on my previous script: powershell-to-list-all-users-and-when-their-password-expires, so that it would send the user an email if their password was going to expire soon. Additionally I wanted to send a summary to our IT staff of accounts that were going to expire soon. Here is that script:
-
PowerShell Active Directory wrapper scripts.
In my PowerShell profile I have a routine the sources all the *.ps1 files in a folder. One of these .ps1 files contains Active Directory “wrapper” functions. I call them “wrapper” functions because they simplify the parameters needed to return data in a format we want. The idea is that I can write a series…
-
PowerShell script to silently install RSAT 2008 R2 SP1
I often re-image my machine – that way I know my SCCM OSD is working properly and has the most recent “secondary apps” (Reader,Flash,FireFox . . .). Because I am always re-imaging, I like to automate installing the software I always need like Remote Server Administration Tools – RSAT. I wanted a function to install…
