Archive

Archive for the ‘Server’ Category

Scripting up an Active-Directory Test Environment through PowerShell

April 11th, 2009 Niklas Goude No comments

The first step in building up a Test Environment is analyzing the data that we have to work with. In this case, the Star Trek Reference Csv file.

Since the Csv file doesn’t say sAMAccountName or organizationalUnit I’ve to set up a routine for handling this. Based on the information, I’ve set up the following rules:

User Information

  • Common Name = Character Name
  • sAMAccountName = First 3 Characters from givenName and surName
  • userPrincipalName = sAMAccountName and Domain
  • DisplayName = Character Name
  • givenName = First part of Character Name
  • surName = Last part of Character Name
  • Description = Postition + Species
  • l = Starship
  • streetAddress = Location
  • physicalDeliveryOfficeName = Starship
  • Title = Rank
  • Department = Department
  • Company = Starship
  • mail = CharacterName and Domain

Computer Information

  • Common Name = Starship
  • sAMAccountName = Registry
  • Location = Location
  • Description = Starship

Group Information

  • Common Name = Position
  • Description = Position
  • sAMAccountName = Position

Group MemberShip

  • Members = Based on Users Position

Organizational Unit Structure

  • ou = Series
  • l = Location
  • Description = Starship
  • Child OU: Computers
  • Child OU: Groups
  • Child OU: Users

Users HomeFolder

  • HomeFolder = Based on Users sAMAccountName and a defined Path

Most of these steps may seem trivial and easy to script up based on a Csv file, but there are numerous steps to consider, for example: some Characters, such as T’pol and Phlox don’t have any surnames (at least not any surnames recorded in the Vulcan Database) so these names must be handled in the script. Another step to consider are sAMAccountNames conatining a invalid set of characters and so on. I’m going to go through each step of the scripts and explain in detail how to avoid the exceptions that we might encounter in each new post regarding the migration.

The Scripts will also use the Get-AD.ps1 script when chekcing if objects exist in the Domain.

Next step is Part 1.1: Adding Ou Structure using Powershell

The Get-AD.ps1 script.

Here’s a link to the Csv File refered to in this post.

Rating 3.00 out of 5
[?]

Migrate From Windows Server 2003 to Windows Server 2008 R2 and Windows 7 Using PowerShell

April 11th, 2009 Niklas Goude No comments

Windows 7 and Windows Server 2008 R2 are just around the Corner. Beta Versions are very promising and, as it seems, the best OS that Microsoft has ever done! This is something that’s not easy to accomplish in the Beta stage of an OS, but Microsoft has pulled it off! The comparisons that I’ve made with previous Operating Systems are entirely based on self observations.

I’m hoping that alot of people share my enthusiasm regarding the Windows 7 technologies and I would like to share my Beta tests with the Microsoft Community. I’m aware that a few commands and techniques may vary from the final Release so the following posts might not be accurate when the final build of Windows 7 / 2008 R2 are released. I will try to keep these posts up to date and follow Microsfts development of Windows 7 and Windows Server 2008 R2.

Scenraio

You have a Windows 2003 Active-Directory Environment that you want to Updgrade / migrate to a Windows 2008 R2 environment. Microsoft have a great tool called ADMT (Active Directory Migration Tool) which allows you to perform the appropriate steps when migration from Windows 2003 to Windows 2008. But since this is a PowerShell Blog, I’m going to show examples on doing all these steps through PowerShell. I’m planning on showing the following steps:

Windows 2003

Windows 2008 R2

  • Gathering information from a 2003 Active Directory Domain through PowerShell
  • Migarting OU Structure to a Active-Directory 2008 R2 Server Through PowerShell
  • Migarting Users to a Active-Directory 2008 R2 Server Through PowerShell
  • Migarting Computers to a Active-Directory 2008 R2 Server Through PowerShell
  • Migarting Groups to a Active-Directory 2008 R2 Server Through PowerShell
  • Migarting Group Membership to a Active-Directory 2008 R2 Server Through PowerShell
  • Migrating HomeFolders to a Active-Directory 2008 R2 Server Through PowerShell
  • Migrating a Windows 7 Client to a Active-Directory 2008 R2 Server Through PowerShell
  • Note that all steps are built from a test environment and may require slight adjustments to fit your environmnent.

    Rating 3.00 out of 5
    [?]