Skip to main content

Posts

Showing posts with the label ServerCore

Use PowerShell to Create New AD Users using a Template

To use and existing account as a template to create new users one would use the good old "Active Directory Users and Computers" , right? by right-clicking on the User to be used as template and selecting "Copy" which will prompt something like below: But this blog is  meant for doing things using PowerShell. To quickly get me started I was tempted to use "Active Directory Administrative Center" on Server 2012, so that I could see the PowerShell history for the my actions( Yeah! you can do that now !!) but there was no method to do that in AD Admin Center :O , See below   The User "Dexter POSH" is the member of the group "RemotePOSHAdmins" under the OU "POSHAdmins" in my domain. I want to add a new User here using the dexterposh user account as the template. At first I thought of simply getting the User information using Get-ADUser and piping it into New-ADUser cmdlet (because it accepts pipeline input of type ...

Enable Auditing KCC in ServerCore

In a Windows Environment running Active Directory, Knowledge Consistency Checker (KCC) is responsible for creating connection objects and builds replication topology which is at the heart of Multi-Master Replication. To audit if the KCC is up and running or actually the replication changes are occurring, We can enable auditing by changing a Registry Entry. But as I have a ServerCore running a Domain Controller I will do this on it First Create a New PowerShell Session and then enter it. Most of you will be familiar with PSDrives which are nothing but an abstraction which helps you see various datastores like Registry as Drives. Now the HKLM:\ is the Drive for HKEY_LOCAL_MACHINE registry hive. HKLM:\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics is the Registry key where we need to change the "1 Knowledge Consistency Checker" property to any value between 0-5 where 0 is no auditing and 5 is the  maximum auditing messages. I will select 2 just in case. Go ahead and c...

Enable-RemoteDesktop -computername DexServerCore

Now, Basically why to enable remote desktop on a ServerCore ? When you have already WinRM and PowerShell remoting already kicking. Well, I honestly can't say why to enable it...cause I have the ServerCore machine sitting up on my Hyper-V Server and I could "connect" to it as easily. But it's good to know that it could be done. With Server 2012 you could add a GUI or a Servercore...but there is something called Minimal Server Interface as well in Server 2012 (plus Server 2012 gives you ability to switch between all these installations too). So you might want to read up on this here . So a use scenario can be to add Minimal Server Interface on a remote host for the time being , Enable Remote Desktop  and perform Admin tasks which occur rarely. How to Enable Remote Desktop ? Well from what I could understand there are 2 registry entries which control this. 1. fDenyTSConnections under  'HKLM:\System\CurrentControlSet\Control\Terminal Server'. This Re...

ServerCore + Create Test Users using Facebook

So Recently my VHD got corrupted and had to make the VHD Boot again work. Thankfully I had all the PowerShell one-liners I used to get my Lab up in less time. First of all I will add 100 test users by following this awesome Hey Scripting Guys Blog Post . To make things a bit clear I am on a workstation with RSAT for Active Directory installed and my DC is a servercore machine. Just to give a hint when I need to run a cmdlet to get any information from the AD, I need to specify the name of the DC with -Server  parameter from where I want to get the information but a new connection will be opened and closed for each cmdlet invocation. For Example : Get-ADForest -Server dexservercore.dexter.com Better way explained in Active Directory PowerShell Blog is to map a PSDrive for better performance. Since I have only one DC in my test environment , when I Import the ActiveDirectory Module it will automatically map a PSDrive on my remote workstation. Now I don't want to a...

Deploying AD Domain using PowerShell + Completing LAB Setup

I would like to divide this post in two parts : 1. Deploying a domain dexter.com on my Server Core . 2. Adding my Physical Host running Server 2012 to the domain dexter.com. Step 1. Deploying domain dexter.com on my Server Core. First of all I need to add the Active Directory Domain Services role in my Server Core. To get the Active Directory Roles on my Server Core use the following cmdlet The highlighted entry shows that the AD-Domain-Services Role is already installed on my Server Core. But if it is not then you can issue the following to install it. Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools Now the role is installed and till Server 2K8 R2 , one would have gone and run the dcpromo.exe (this one is deprecated now with Server 2012) but here I will try to use PowerShell ..this is the link I followed Windows Server 2012 has a new module named " ADDSDeployment" and if I check the cmdlets supplied:   You get the idea...Now...

Assigning Static IP Address to the Server Core

Now for the first time you boot a Server Core..you get nothing but a Command Shell (cmd.exe). Now before we begin further let's assign a static IP address to the Server Core VM. REMINDER : My Lab has server named "DexterPOSH" Server 2012( on Physical Host) and then in Hyper-V a VM named "dexservercore" running Server Core 2012. Open "Hyper-V Manager" and Right-Click and "Connect" to the VM (start it if it is not started yet) There are actually three ways to do this..You may be familiar with all three maybe but I wanted to list all the ways to do this. 1. Using Netsh utility - this one is old school But this one is depreciated see the screenshot below..It's recommending PowerShell ( will cover it in 3rd step) anyways to set the IP address..first get your interface by using : Now I have the interface with me...Time to set the IP address (old school) Okey done. 2 . Using Sconfig utility - Server 2K8 R2...

Server 2012 and Server Core...New Plan

I am taking this new initiative to learn Server 2012 along with Server Core..... Lab Setup: I have VHD booted Server 2012 with full blown GUI on my Physical Machine (Name - DexterPOSH). Then I have enabled the Hyper-V role on my this machine and installed a Server Core 2012 on a VM created in the Hyper-V (Name - DexServercore). Along doing this Lab Setup, I came to learn cool things and I want to share them: Step 1 : Download the trial Server 2012 iso. Step 2 : I have a Windows 7 box , so to test the Server 2012 I am going to VHD Boot the Server 2012 for 180 days (license period) then delete the VHD and the boot entry. Here is a great article on how to do this for Windows 8 but the steps are the same for Server 2012 too. Step3 : Once you have VHD Booted your machine to Server 2012. Open our favorite PowerShell console and run the following to install Hyper-V role on the host  Get-WindowsFeature -name *hyper* | Install-WindowsFeature Reboot your machine to complete ...