Domain Controller FSMO Role Holders, Transfer and Demote

| 2015/10/19 09:56
List of useful resources and brief information

Determining FSMO Role Holders

Netdom (part of Windows server support tools)

netdom query /domain:<myDomainName> fsmo

Demote a domain controller

List and delete files using Windows PowerShell

| 2015/10/19 09:51
To list files of specific type(s) on the disk or directory including all sub-directories
get-childitem c:\ -include *.tmp, *.temp, *.bak -recurse 
get-childitem D:\Projects\abc*\ -include *.bak -recurse 
The commands above will list on screen all files with extentions TMP, TEMP or BAK located on disk C:\ and all subdirectories or located on disk D:\ in directory PROJECTS and all subdirectories with name starting with ABC and their subdirectories.

Number of virtual processors in Hyper-V Guest Operating Systems

| 2014/10/19 10:43
Article on Microsoft Tech Net with the latest information for the supported number of virtual processors and integration services when running different guest operating systems (virtual machines) on Windows Server 2008 R2 Hyper-v


Hyper-V and BIOS settings

| 2014/10/19 09:25
Hyper-V hardware requirement1. 64-bit (x64) processor and 64 bit Windows 2008 (R2) server2. Hardware Virtualization Assists
Enable in the system BIOS:- Intel VT-x (initially codenamed Vanderpool)
- AMD AMD-V (also called SVM and initially codename Pacifica)

3. Hardware Data Execution Prevention
Enable in the system BIOS:- Intel Execute Disable (XD)
- AMD No Execute (NX).
4. SLAT hardware - required for using RemoteFX, highly recommended for traditional server virtualization

Create application log file in C# / Write to File example

| 2014/10/19 08:55
Application log file example
private string logFile = "full path and file name (C:\\temp\\MyApplicationLog.txt)";
WriteToLogFile("your application message", logFile); // use any time to add record to the log file
public void WriteToLogFile(string strMessage, string outputFile)
   string line = DateTime.Now.ToString() + " | ";
   line += strMessage;
   FileStream fs = new FileStream(outputFile, FileMode.Append, FileAccess.Write, FileShare.None);
   StreamWriter swFromFileStream = new StreamWriter(fs);