Selecting the default operating system on a workstation

Bcdedit.exe is a command-line tool that is used to interact with the boot configuration data store. In the boot configuration data store all the configuration parameters needed to boot the operating system are stored.

To configure what operating system to run at start-up using bcdedit.exe you’ll have to do the following:

1. Start a command prompt with administrator credentials (right click ” Run as Administrator”) 

run as administrator
2. Type bcdedit /enum to see the installed operating systems (also you can use bcdedit /enum ACTIVE to see the active OS):
bcdedit command
4. To select which OS (operating system) to run by default at start-up type the following:
example : bcdedit /default {879f7be0-2163-11de-b92d-d86aaca536b1}
the numbers in the “{” are the unique identifier of the OS or the resume object.
If you have multiple OS installed and you want to create a boot order you cand type the following:
example : bcdedit /bootsequence {879f7be0-2163-11de-b92d-d86aaca536b1} {14587be0-2163-11de-b92d-d86aaca536b1} {ntlr}
or
bcdedit /bootsequence {879f7be0-2163-11de-b92d-d86aaca536b1} /addfirst
bcdedit /bootsequence {14587be0-2163-11de-b92d-d86aaca536b1} /addlast
You can do allmost the same thing using the msconfig.exe tool. Open run (windows key+r) and type Msconfig or Msconfig.exe. Go to the boot tab and there you’ll see the list of the operating systems installed
msconfig command
From there you can modify the order, advanced options etc. I will discuss about msconfig tool in more detail in a future post.

Windows 7 temporary profile

This post addresses the issue regarding when logging in Windows. Sometimes it happens that when you login to Windows you are logged in a temporary profile. This problem is very annoying because sometimes even if you log off and try to login again the problem persists. The thing is that windows creates a .bak profile. To fix this problem you have to modify the registry from your computer. First of all open run ( press the windows key + r or type run in search bar ) and type “regedit”.

Windows Server

Navigate to the following path HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList and delete the .bak files.

Windows 7

How to configure network connection on Windows 7

Many Administrators prefer “netsh” command when configuring a network connection because the tool is more powerful then using the normal interface and has many options.

If you want to configure the Local Area Connection with a IPv4 address, network mask and gateway you will type something like:
First of all open a command prompt using administrative credentials.
netsh interface ipv4 set address “local area connection” static 192.168.1.15 255.255.255.0 192.168.1.1
In this example I have configured the IP 192.168.1.15 with a network mask of 255.255.255.0 and a gateway 192.168.1.1
If you want to configure also the DNS type:
netsh interface ipv4 set dnsservers “local area connection” static 192.168.1.2
where 192.168.1.2 is my dns ip address
If you want to use DHCP to get a dynamic IP address and DNS server enter the following in cmd:
netsh interface ipv4 set address name=”local area connection” source=dhcp
netsh interface ipv4 set dnsservers name=”local area connection” source=dhcp

IP address (internet protocol) : is a protocol used to communicate between different machines over the internet.
DNS (domain name system) : is a service that translates names intro IP addresses
DHCP (dynamic host configuration protocol) : is a service that dynamic assigns the configuration needed to communicate over the internet (ip, mask, dns etc.).
Gateway : is a device that connects the local network with the internet (usually a router ).

How to bind server with KMS Server

This document is a tutorial on how to bind a computer on the respective KMS Server when the automatic binding is not working. First of all you’ll have to know the KMS server ip address. After finding the ip address open a command prompt to test the connection with the KMS server. When cmd windows appears type the following:
Telnet “server ip address” 1688 – This command tests if the KMS server has opened the 1688 port in order to communicate with the server that you are trying to activate. 1688 port is the stanard port for the KMS service. You’ll have to be in the local administrators group on that server.
Now open a command prompt or Powershell and type the following:
slmgr –dli – this will show you the actual configuration of the server.

Now type the command slmgr -ipk sku-key – The command will insert the serial key.

After adding the serial stype slmgr – ato – This will activate Windows with the new key you have specified. Since it is a SKU, if a KMS is present and broadcasting on network and DNS data is ok on the machine, it should retrieve the KMS server automatically.

After that type slmgr –dlv  – This will display the current license status on the machine

If you have to do this on several servers you can add all the commands in notepad and then save the file as a .bat or .ps1. Then just run the file on any server that has the same configuration and uses the same kms server.

To find out more options using slmgr type in powershell slmgr and the following screen will appear:

Windows Server
This screen shows the global settings of the slmgr command. Now press “OK” once:
Information Technology
This screen shows the advanced settings of the slmgr command. Press “OK”
Powershell
This screen shows the commands used in Volume Licensing: Token-based activation method. Now press “OK” again:
Windows license
The screen displays the Volume Licesing using KMS options.

How to execute commands remotely using Windows Powershell

I am using “PSexec” command when executing a remote command with windows powershell. Here is an example of how to use this command.
First of all you have to download the package from Microsoft technet website. The URL is:
After you’ve downloaded the .zip file, extract the commands or only PSexec command to your windows system folder. In my case the path is C:\Windows\System32.
After that, start windows powershell and type PSexec. The legal agreement appears you’ll have to press “Accept” in order to use the command. You can type the following command : “Get-help PSexec” and the following screen will appear:
Windows Server

 

This command will explain the basics of how to use PSexec command. I am trying to execute ipconfig /all to find out the gateway of a server but I get the following error “Logon failure: unknown user name or bad password”. If this problem occurs you’ll have to enter the credentials that the session will use to logon to the remote server. To do this include the -u parameter in the command. After typing the -u you’ll have to type the domain name followed by “\” and the username. You can either add the -p parameter followed by the username password in clear text or let the command without it. The password promt will automatically show. This is an example of this command:
psexec.exe \\server -u domain\dan_popescu ipconfig /all
PSexec is very usefull in many situations. For example to debug a problem on a remote computer you can start the cmd.exe remotely and then execute any command.
psexec.exe \\server -u domain\dan_popescu cmd.exe.
Upon finishing type “exit” to leave the remote machine and return in your computer. Windows powershell will display something like “the command used” on “remote machine” “with error code 0”.