Archive for category Microsoft
Forcibly Remove Dfs Nameserver
Posted by edwgon in 64-bit, Active Directory, dfs, domain controller, folder redirection, management, Microsoft, Windows Server 2008, Windows Server 2012 R2 on June 11, 2017
The following steps can be used to remove a Dfs nameserver that no longer exists in your environment.
- Log on to a Dfs server
- Open an elevated command line
- We’re going to use dfsutil with the following parameters: dfsutil diag unmapdomroot \<domainname><DFSname> \<DFSrootserver><DFSshare>
- As a sample: dfsutil diag unmapdomroot \\DfsRootName\DfsFolderName \\Server_to_remove\DfsFolderName
- No need to reboot just wait for replication
Renaming Windows Domain Controllers
Posted by edwgon in 64-bit, administrator, command line parameters, dfs, domain controller, Microsoft, Netdom, reboot, registry, Windows Server 2008, Windows Server 2012 R2, Windows Server Feature on June 10, 2017
The following are the steps needed to rename a domain controller; the steps have been tested up to Windows Server 2016.
Note: If your DC is also acting as a Dfs nameroot server, make sure you remove the nameserver from Dfs first!
From an elevated command line, type the following commands:
- Add the new domain controller name NEW_DC; we’re replacing OLD_DC
NETDOM COMPUTERNAME OLD_DC.companydomain.com /ADD:NEW_DC.companydomain.com - Designate the new name as the primary computer name; OLD_DC gets removed and NEW_DC is new primary name
NETDOM COMPUTERNAME OLD_DC.companydomain.com /MAKEPRIMARY:NEW_DC.companydomain.com - Reboot domain controller
- Now, let’s remove the old domain controller name from Active Directory
NETDOM COMPUTERNAME NEW_DC.companydomain.com /REMOVE:OLD_DC.companydomain.com - Sync all DCs
In the event that you didn’t notice the warning on top and you went ahead and renamed the domain controller and you had Dfs services running on it, here are some instructions on how to manually remove Dfs nameserver and fix the issue.
- Log on to the recently renamed domain controller
- Open Regedit.exe
- Go to HKLM\Software\Microsoft\DFS\Roots\domainV2
- Delete the key found under domainV2 and reboot your server
- Next, remove the Dfs share from the server
- Now you can delete the Dfs folder
- Done
Run PowerShell Script in Schedule Tasks
Posted by edwgon in 64-bit, Microsoft, PowerShell, Scheduled Tasks, windows 7, windows 7 x64 on September 19, 2016
The following will allow you to run a Powershell script as a scheduled task. These instructions have been tested on a Windows 7 64bit computer.
Before proceeding, make sure your Powershell script runs without any errors. The best way to make sure your script is running fine is by calling it from a command prompt.
Note: Make sure you run Set-ExecutionPolicy from an elevated Powershell window to make sure your system (Windows 7) is allowed to run Powershell scripts.
- Open a Command Prompt window
- Run: powershell -file <your ps script file>
- Make sure it executes properly
Now, open Windows 7 Task Scheduler:
- In the Actions tab
- Power shell is found at: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
- You can also just use powershell.exe
- In Add arguments (optional) field, add the following: -File “C:\Path-to-your-script\Your-ps-script.ps1”
- Sample: -File “C:\Program Files (x86)\Info Folder\Get-Speed.ps1”
- In Start in (optional) field, add the following: C:\Program Files (x86)\Info Folder
- Sample: C:\Program Files (x86)\Info Folder
I’m not going to go over the other sections as this is the main section to be able to execute Powershell scripts from Schedule Tasks.
Get Active Network Adapter
Posted by edwgon in Microsoft, Microsoft System Center Configuration Manager 2012 R2 SP1, Network, powercli, PowerShell, SCCM 2012, Utilities, Windows Server 2008, Windows Server 2012 R2 on May 18, 2016
Recently I had the need to create a script to find out what was the active network adapter in our server, so after some ideas from the web, I came up with a one line PowerShell script that helped me achieve my goal.
Note: Get-NetAdapter is a PowerShell commandlet that’s present on Windows 8 and Windows Server 2012 R2. This command will not work on Windows 7.
Get-NetAdapter | Where-Object {($_.LinkSpeed -eq “1 Gbps”) -and ($_.Status -eq ‘Up’)}
In this line, I’m basically getting the adapter with status ‘Up’ and with a linkspeed equals to ‘1 Gbps’. One can change LinkSpeed property to match your server’s network adapter speed(s).
Windows 10 Licensing On A Windows Server 2012 R2
Posted by edwgon in Microsoft, Volume Activation, Windows Server 2012 R2, Windows Server Feature on September 16, 2015
Recently I began to get ready for Windows 10, and part of that process was to get our licensing servers up to date. Since I was getting multiple answers on Microsoft TechNet forums, I decided to open a call with Microsoft Support and get a definitive answer – all information below has been confirmed with Microsoft.
First, Windows Server 2008 R2 will be able to provide licenses for your Windows 10 fleet, with a catch. Microsoft will be deploying a Hotfix for Windows Server 2008 R2 in a month or two, maybe a bit longer, so if your organization can wait, then just hold on tight.
- Add a Windows Server 2012 R2 HotFix, which can be found here
- Reboot server
- Add a SRV record to any of your primary domain controllers
- Wait for all domains to synchronize DNS information
- Install the correct KMS host server key
- You’ll need to go to licensing.microsoft.com and download the proper KMS host server key
- For Windows 10 licensing on a Windows Server 2012 R2 server, we’ll need the following key: Windows Srv 2012R2 DataCtr/Std KMS for Windows 10
- Use the following commands, in an elevated CLI, to register and activate the KMS host server key
- SLMGR /ipk CCCCC-XXXXX-PPPPP-KKKKK-MMMMM
- SLMGR /ato
- After allowing all DCs to synchronize, we’re going to run a command to make sure that the new KMS server is ready to authenticate clients
a. nslookup -type=srv _vlmcs._tcp
b. Copy and paste the command in step 5a onto a desktop and results should be as shown in the screenshot below - These steps will allow you to install the proper host server key and allow your Windows 10 clients to get licensed.
Recent Comments