Friday, January 9, 2015

Mapping Servers Drives by using "Net use" with username and password DOS

Client Require that All drives from ServerA andS erverB to be mapped in ServerC

The client is implementing a new file server called ServerC, and he requires that all the drives from ServerA and ServerB to be visible in ServerC to do the migration of all the company data from SrvA and B to the serverC. Here's the scenario in image

I will make a table to assist me in the creation of the drives

Now I can comply the request by creating a script called: 'mapping.bat' in notepad or notepad++. As Follows:
net use I: "\\\C$" /user:"SERVERA\administrator" Pa$$w0rd$ /p:YES
net use J: "\\\D$" /user:"SERVERA\administrator" Pa$$w0rd$ /p:YES
net use K: "\\\F$" /user:"SERVERA\administrator" Pa$$w0rd$ /p:YES
net use L: "\\\G$" /user:"SERVERA\administrator" Pa$$w0rd$ /p:YES
net use O: "\\\C$" /user:"SERVERB\administrator" C0ntr3s3n4 /p:YES
net use P: "\\\D$" /user:"SERVERB\administrator" C0ntr3s3n4 /p:YES
net use Q: "\\\F$" /user:"SERVERB\administrator" C0ntr3s3n4 /p:YES
net use R: "\\\G$" /user:"SERVERB\administrator" C0ntr3s3n4 /p:YES

Script Explanation

In line number 1, we just clean all the "network drives" that can be in use

* : A comodin to says all drives.
/D : Short for /delete
/Y : Short for /yes (so the scripts doesn't require user's confirmation).

Note: If you have any map drives already mapped and you wouldn't wanna clear, then just comment (by adding REM at the start of the line) or delete this line.

In the following lines we do the mapping I will explain line 2:

net use I: \\\C$ /user:SERVERA\administrator Pa$$w0rd$ /p:YES

Net Use: Command used to connect network drives.
I: Drive to map (it should not be on use by any other hard drive or DVD,BLUERAY or network drive).
"\\\C$": Specified the IP of the computer and the resource C$, the "$" at the end means that you will need administrative privilegies.
/user:SERVERA\administrator this option specifies the local admin from that machine (it can be a domain\user as well).
Pa$$w0rd$ Specifies the password from the user
/p Specifies the persistent option

Please consider to donate and thank you very much for reading this.

Monday, January 5, 2015

How to easily add DNS Reverse using Azure Powershell

Instalation of Windows Azure Powershell

Here's the easiest way to install this is to follow the steps in:Microsoft Web Platform Installer and follow the wizard's steps. If for any issues you need a complete guide: Install and Configure Windows Powershell .

How to add the DNS Reverse into a VM

In windows Azure a VM is hosted by a "Cloud Server", we will need the "name" of that "cloud Server". And the DNS Reverse Resolution name (well format name ended by a dot). I think the easiest way is to modify line 1 and 2 from the folowwing powershell script:

/*Programmer: jortega added this*/
Made by MCSE Server Infrastructure and messaging
$CloudService="jdotex"           #Change the service name of the VM
$ReverseName="" #Ended by a dot
Set-AzureService –ServiceName $CloudService –Description "Exchange Reverse DNS" –ReverseDnsFqdn $ReverseName
And this is the result of copy&paste into a windows azure powershell console:

In the following link are more information if you want to extend your knowledge: Announcing reverse DNS for azure cloud services

Here's the test

Up and running

Please consider to donate and thank you very much for reading this.