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 * /D /Y REM
net use I: "\\172.30.2.6\C$" /user:"SERVERA\administrator" Pa$$w0rd$ /p:YES
net use J: "\\172.30.2.6\D$" /user:"SERVERA\administrator" Pa$$w0rd$ /p:YES
net use K: "\\172.30.2.6\F$" /user:"SERVERA\administrator" Pa$$w0rd$ /p:YES
net use L: "\\172.30.2.6\G$" /user:"SERVERA\administrator" Pa$$w0rd$ /p:YES
net use O: "\\172.30.2.7\C$" /user:"SERVERB\administrator" C0ntr3s3n4 /p:YES
net use P: "\\172.30.2.7\D$" /user:"SERVERB\administrator" C0ntr3s3n4 /p:YES
net use Q: "\\172.30.2.7\F$" /user:"SERVERB\administrator" C0ntr3s3n4 /p:YES
net use R: "\\172.30.2.7\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
NET USE * /D /Y REM

* : 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: \\172.30.2.6\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).
"\\172.30.2.6\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 jortega928@yahoo.com/j0rt3g4@j0rt3g4.com
https://www.j0rt3g4.com
$CloudService="jdotex"           #Change the service name of the VM
$ReverseName="mail.j0rt3g4.com." #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.