network

Map a network drive using PowerShell

Make sure you are using the latest version of PowerShell. On Windows 8/10 run it as administrator and type the following:

Where:

Z – is the Drive Letter

Within ” ” is the path of the network share that will be presented as the root of the drive letter Z

The -Persist parameter so that you can not only see the name of your new drive in Windows explorer, but also know it’s still there the next time you logon.

-Name <String>
Specifies a name for the new drive. For persistent mapped network drives, type a drive letter. For temporary drives type you are not limited to drive letters.
Required? true
Position 1

-PSProvider <String>
Specifies the Windows PowerShell provider, for example, FileType or Registry.
Required? true
Position? 2

-Root <String>
Specifies the data store location, for example, \\Server\Drivers, or a registry key such as HKLM:\Software\Microsoft\Windows NT\CurrentVersion.
Required? true
Position? 3

Create a Virtual Machine with 2 NICs in Azure Classic

Unfortunately, in Azure you cannot create a Virtual Machine in the GUI with 2 Network Cards. You cannot even add a 2nd NIC to a VM once it has been created. The only way to create a VM with 2, is to specify the additional NIC’s at the time of creation and ONLY via powershell. I have compiled a Powershell script that will do this. I have also listed the commands next to each comment to get the value to put there. Copy the code below into a PS1 and launch it from a PowerShell window.

How to remove hidden network adapters

Windows automatically hides devices that are not presently connected to the system, but they still exist in Windows’ configuration. This is especially problematic when changing virtual network adapters and not being able to remove IP configurations from old adapters. To resolve:

  1. Click Start, click Run, type cmd.exe, and then press ENTER.
  2. Type “set devmgr_show_nonpresent_devices=1“, and then press ENTER.
  3. Type Start DEVMGMT.MSC, and then press ENTER.
  4. Click View, and then click Show Hidden Devices.
  5. Expand the Network Adapters tree.
  6. Right-click the dimmed network adapter, and then click Uninstall.

How to setup network after RHEL/CentOS 7 minimal installation

After installing RHEL/CentOS 7 minimal, You may not able to connect network in that machine. This will happen because Ethernet interfaces are not enabled by default.
This guide explain you to setup network on RHEL/CentOS 7.

Setup network on CentOS 7 minimal

First, type “nmcli d” command in your terminal for quick list ethernet card installed on your machine:

CentOS_7-network-setup

“nmcli d” command output

Type “nmtui” command in your terminal to open Network manager. After opening Network manager chose “Edit connection” and press Enter (Use TAB button for choosing options).

CentOS_7-Network-manager-screen

CentOS_7 Network manager screen

Now choose you network interfaces and click “Edit

Edit-your-network-interfaces

 

Edit your network interfaces

DHCP configuration

Choose “Automatic” in IPv4 CONFIGURATION and check Automatically connect check box and press OK and quit from Network manager.

Set-ip-adress-using-DHCP

Set ip adress using DHCP

Reset network services:

Now your server will get IP Address from DHCP .

CentOS-7-check-ip-address

CentOS 7 check ip address.

Windows: Remove hidden NIC

Applies to Windows 2003

I was getting this error after have made some change with my virtual NIC adapters. The error I was facing was this one, when I was making changes to the only NIC there was installed:

The IP address XXX.XXX.XXX.XXX you have entered for this network adapter is already assigned to another adapter Name of adapter. Name of adapter is hidden from the network and Dial-up Connections folder because it is not physically in the computer or is a legacy adapter that is not working. If the same address is assigned to both adapters and they become active, only one of them will use this address. This may result in incorrect system configuration. Do you want to enter a different IP address for this adapter in the list of IP addresses in the advanced dialog box?

The problem was that I had an old “ghost” NIC with some settings applied to it. The NIC was no longer installed so I was not able to remove or change the settings the normal way. First I tried to find the information in the registry, but there were a lot of entries and it didn’t seem to work. Then I did what I always do in those situations.


1. Open a command prompt and enter the commands above.

 

 

 

 

 

 

 

 

 

 

 

 

2. From the view menu select: Show hidden devices

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3. Select the NIC that are removed from the system and right click and chose “Uninstall”
The NIC that are grayed out are no longer in the system

After following the above steps I was able to change the IP settings on my NIC without any warning.