A good way to start writing a custom function in PowerShell is an advanced template like this.
This is my custom PowerShell function template, whenever I’m writing a new script I’ll start with one of my templates. Having consistency in structure and naming of code is an important part in collaboration.
As in on of my last post I’ve showed you my approach to manage distribution groups in the hierarchical structure of an ActiveDirectory installation. In the mean time I’ve adapted a similiar approach for the security groups.
One of my company’s requirements is the retention time of 10 years for user accounts and their mailbox data, I have to admit, this might not be common or even recommended.
However I have to deal with it.
One problem to face is the availabilty of user account names, by the number of about 500 employees there’s a hight change that two or even more people are having the same name.
To clean up the available names in the system I’ve written a script that renames a users identity and the mailboxes address.
So let’s see what this script does: