Skip to main content

Posts

Showing posts from June, 2010

Updating a Extended property based on Group Membership Powershell GUI

Group membership has long been used in directory services to provide a way of giving access to different objects, distribution lists and a variety of other useful things to solve everyday problems in both active directory and Exchange Infrastructures. There are a number of things that you can’t do with Groups in Exchange which can be slightly limiting if you’re trying to solve certain problems in an easy and flexible manner. Exchange provides a whole bunch of extended properties in Active directory that can be used for various things one of the more useful of this is being able to apply a specific proxyaddress based on a specific value set in a extended property via a recipient policy. It can also be useful in Transport Agents and Transport Rules and a number of different application uses. For example in most mail systems you will have logical grouping of users into distribution lists maybe loosely based on department function etc. If for example your sales department want to use a spe

Enumerting the members of a nested group with ADSI and powershell

Its often useful with scripts and applications to be able to use Group membership to control what users are affected by a particular application or script. Enumerating nested group members in powershell seems to be a bit of art and there are few different approaches none of which i particular liked so i came up with my own. The following approach uses two hash tables to ensure that if a user is in multiple groups they only get enumerated once and also any circular group nesting are taken care of as well seems to work well for me so i thought I'd share it. In the case of this script he $groupName is the DistiguishedName of the Group you want to enumerate the members of. $repeathashGroup = @{ } $repeathashUser = @{ } function Get-member($GroupName){ $Grouppath = "LDAP://" + $GroupName $groupObj = [ADSI]$Grouppath foreach($member in $groupObj.Member){ $userPath = "LDAP://" + $member $UserObj = [ADSI]$userPath if($UserObj.groupType

Exchange proxyaddress display and removal powershell gui for Exchange 2003,2007,2010

ProxyAddresses are something in Exchange environments that can be a challenge to maintain over a long period of time and also during migrations or consolidations something that you need to deal with. If your lucky then just modifying your recipient policies may work the magic that you need if not and you have a large number of users that you need to modify you need to look at creating a script or doing a lot of mouse work. The first challenge if your going to write a script to do this is because your going to be deleting information just doing a one-liner or simple script may mean you will end up removing more information than you want. So one way to tackle this is using a simple GUI script that will allow mutiple selects to at least control what and which accounts you are going to affect. The good thing about createing a simple Gui is that it can also be used to do some analysis first. So the script i've created allows you to search based on the proxy address domain you want t
All sample scripts and source code is provided by for illustrative purposes only. All examples are untested in different environments and therefore, I cannot guarantee or imply reliability, serviceability, or function of these programs.

All code contained herein is provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.