
The PowerShell method for getting FSMO roles isn’t quite as simple as command line because you have to check the domain wide and forest wide roles separately. The output will show all of the roles and which domain controller holds them: C:\Windows\system32>netdom query fsmo.Open command prompt (CMD.exe) as as admin on one of your domain controllers (or use Psexec to open it remotely).Right now we’re going to use it to check the FSMO roles. Netdom itself is a tool that can be used for many purposes.
#Netdom commands windows#
What are the three domain wide roles?Īs with most things in Windows land, you can check FSMO roles via command line or PowerShell.


Within the realm of FSMO roles there are three roles for each domain and two roles for each forest. Before you retire a domain controller you need to check it’s FSMO roles and make sure to move any off of it to another properly functioning domain controller.įailure to do so can be anything from a nuisance (because you have to manually clean up AD after decommissioning your DC) to catastrophic and potentially leading to a Disaster Recovery (DR) restore of your domain or a complete rebuild (yikes!). Generally, these roles are best left where they are at.Įventually, though, you’re going to want to add a new domain controller to your domain and retire old ones. When you first deploy a domain controller on a fresh domain these roles are assigned to that domain controller. (Get-WmiObject win32_computersystem).rename("newname")Īdd-computer -Credential iammred\administrator -DomainName iammred.Flexible Single Master Operation Roles (FSMO Roles) are an incredibly important aspect of Active Directory. An example of using Windows PowerShell to add a computer to the domain, rename the computer, and reboot the machine is shown here. In addition, the Windows PowerShell command is easier to read, and they support prototyping. In Windows PowerShell 2.0, this is still three commands, but at least the commands are native to Windows 7. Netdom add /d:reskita mywksta /ud:mydomain\admin /pd:password

Netdom renamecomputer member /newname: /userd:administrator The two netdom commands and the shutdown command are shown here.
#Netdom commands windows 7#
But you should not load the RSAT only to access netdom, because you can do what you want to accomplish out of the box (assuming that your box is not Windows 7 Home edition that does not join domains).ĪD, your batch file contained at least three commands to rename the computer, join the domain, and to restart the machine. The RSAT tools are great, and that is where you gain access to the Active Directory module. When it is installed, you still need to go to Programs and Features and turn on the tools you want to load.

You can add netdom to your computer running Windows 7 by installing the latest version of the Remote Server Administration Tools (RSAT). Coupled with an Anzac biscuit, it was quite nice.ĪD, the reason that you cannot use your batch file (containing netdom commands) on Windows 7 is that by default Windows 7 does not contain the netdom command. Therefore, to speak of chai tea is redundant.) Anyway, I decided to use Dajarling tea, brewed a little strong, and I added cloves, cardamom, a cinnamon stick, fresh ground pepper, and 1/3 cup of warm milk. (The word chai, or many of its variations, simply means tea in many languages. Well this afternoon I am drinking something a bit different. Microsoft Scripting Guy, Ed Wilson, is here. Use PowerShell to Replace netdom Commands to Join the Domain
