Random header image... Refresh for more!

Posts Tagged ‘Server Core’

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: ,