Random header image... Refresh for more!

Archive for the ‘Active-Directory’ Category

Adding HomeFolder Through PowerShell

Icon Written by Niklas Goude on April 27, 2009 – 10:26 pm

It’s been some time since my last post now, had alot of things to do at work, but now I’m back OnTrack with my blogging.

Last time we checked out how to add group membership through PowerShell, so now we should have a nice test environment in place, based on Star Trek.

In this post, we are [...]

Tags: ,

Adding Group Membership Through PowerShell

Icon Written by Niklas Goude on April 16, 2009 – 7:37 pm

Time to add some members to our groups. Following the steps in the previous posts, we should now have a couple of Users, groups and computers in our test environment. Group Names are based on the Character position in the Star Trek Csv file so now, all we have to do is match up the [...]

Tags: ,

Adding Groups Through PowerShell

Icon Written by Niklas Goude on April 15, 2009 – 8:08 pm

With our Users and Computers in place, we can start adding groups. The groups will be based on the Postition ocf the characters in the StarTrek Csv file. I’ve chosen position since many characters can have the same position.

First, let’s look at all the unique Positions in the Csv file. I’m also using the Series [...]

Tags: ,

Adding Computers through PowerShell

Icon Written by Niklas Goude on April 13, 2009 – 8:35 pm

Now let’s add a couple of computers to our test environment. The Computer Names are based on the Starships from the Csv file. Since there are alot of characters but not that many different ships we need to get a unique list of ships. We also wnat the Series, Location and Registry values.

PS > $CsvFile [...]

Tags: ,

Adding Users through PowerShell

Icon Written by Niklas Goude on April 13, 2009 – 2:23 pm

Now that we have our OU structure in place, we can start adding users.

Since the Users contain alot of information we’ll go ahead and use the whole csv file.

Let’s take a quick look at the first entry in the Csv file:

PS > (Import-Csv StarTrek.csv)[0]

Character : Jean-Luc Picard
Position : Commanding Officer
Rank [...]

Tags: ,

Adding Ou Structure using Powershell

Icon Written by Niklas Goude on April 13, 2009 – 11:03 am

Starting of, we need to set up a couple of OrganizationalUnits in our test environment. Following the structure set up in Part 1.1.0:

Organizational Unit Structure

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

The first step in scripting up a OU structure from based on the StarTrek Csv file is to collect [...]

Tags: ,

Scripting up an Active-Directory Test Environment through PowerShell

Icon Written by Niklas Goude on April 11, 2009 – 10:26 pm

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 [...]

Tags: ,

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

Icon Written by Niklas Goude on April 11, 2009 – 9:21 pm

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 [...]

Tags: , ,

Get-AD.ps1

Icon Written by Niklas Goude on February 27, 2009 – 12:59 pm

Get-AD.ps1

This Script gets Information About Objects in Active-Directory. It’s got a few Parameters and Switches that allows us to specify what to search for and how to Return the objects found. You can choose which information to return through the Property parameter, you can Save the Information to a Csv file, You can return a [...]

Tags:

Searching through Active-Directory on Windows 2008 Server Core R2

Icon Written by Niklas Goude on January 17, 2009 – 5:01 pm

Searching through Active-Directory can be done using the DirectorySearcher. First we need to connect to Active-Directory.

PS > $Connection = “LDAP://Server1/DC=APA,DC=CORP”
PS > $AD = [adsi] $Connection

We then create a new object containing the Searcher.

PS > $Searcher = New-Object System.DirectoryServices.DirectorySearcher $AD

In order to search through Active-Directory we have to specify a filter that tells the searcher what [...]

Tags: ,

Adding User To Group in Active-Directory on Windows 2008 Server Core R2

Icon Written by Niklas Goude on January 17, 2009 – 4:59 pm

To add our new User to our Group, the add() method is used as shown below.

PS > $Connection = “LDAP://Server1/CN=NewGroup,OU=NewOU,DC=APA,DC=CORP”
PS > $Group = [adsi] $Connection
PS > $User = “LDAP://Server1/CN=jeapic,OU=NewOU,DC=APA,DC=CORP”
PS > $Group.Add($User)

If we look at the memebers of the group, our user will be added.

PS > $Group.member

CN=jeapic,OU=NewOU,DC=APA,DC=CORP

In the AD MMC Snapin, we can view the [...]

Tags: ,

Creating a User in Active-Directory on Windows 2008 Server Core R2

Icon Written by Niklas Goude on January 17, 2009 – 4:55 pm

Creating a user is basically the same as creating a Group or an OU. First we cast the OU we want to use into a [adsi] object and then start setting the properties. After adding all properties we set a password and set Disabled to false, otherwise the account will be disabled.

PS > $Connection [...]

Tags: ,

Creating a Group in Active-Directory on Windows 2008 Server Core R2

Icon Written by Niklas Goude on January 17, 2009 – 2:09 am

We can create Groups in Active-Directory through PowerShell. Step one is to make a connection to the OU where you want to place your Group. In this example I’ll use the OU that i created in a previous post.

PS > $Connection = “LDAP://OU=NewOU,DC=BPA,DC=CORP”
PS > $OU = [adsi] $Connection
PS > $OU

distinguishedName : {OU=NewOU,DC=APA,DC=CORP}
Path [...]

Tags: ,

Creating an OU in Active-Directory on Windows 2008 Server Core R2

Icon Written by Niklas Goude on January 17, 2009 – 1:53 am

When creating Organizational-Units through PowerShell, we can use the Create() method. First we need to connect to the place where we want to create it. In this example I’m going to create an OU in the top level of my domain. If you want to create further down in the structure, simply connect to the [...]

Tags: ,

Connecting to Active-Directory on Windows 2008 Server Core R2

Icon Written by Niklas Goude on January 17, 2009 – 1:43 am

PowerShell doesn’t have any built in CmdLet for working with Active-Directory. Quest has put togheter a couple of real nice Active-Directory CmdLets that automate Active-Directory tasks. Anyway, I’m going to do a couple of posts on managing Active-Directory on a Server Core, through the DirectoryEntryAdapter. First off, let’s take a quick look at my dev [...]

Tags: ,

Installing Active-Directory on Windows 2008 Server Core R2

Icon Written by Niklas Goude on January 17, 2009 – 1:12 am

Server Core is a scaled back installation of Windows Server 2008 where no Windows Explorer is installed. The configuration is done entirly through the Command-Line interface, or by connecting remote using MMC.

All examples regarding Server Core will be done using the Windows Server 2008 R2 Beta edition, available at MSDN.

Starting off, since this is a [...]

Tags: ,

Adding Users to Sharepoint

Icon Written by Niklas Goude on January 6, 2009 – 3:52 pm

Adding Users from Active-Directory into Sharepoint is done in 2 steps. First we will need to Get the information required from Active-Directory and then we need to Add the informtaion into Sharepoint.
Lets start with Active-Directory. Below is an image of the Active-Directory Design in this example:

Since we want to Get the User information we need [...]

Tags: ,