25 May, 2010

Never be prompted for a password again via RDP

Hi,

I connect a lot using RDP to my servers, each time need to remember to save the connection or retyping the password.

A small registry key would force ALL RDP connections to autologin using your current username and... wait for it... PASSWORD!!!

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Terminal Services\fPromptForPassword
registry value should be set to 0

there is also a KB Article to do this using GPO.

Bye...

20 May, 2010

Central Fortigate Backup script

Hi,

I have several sites with fortigate as the firewall and a lot of on the fly changes on them, I wrote a script for automatic backup of the fortigates, it uses the following tools:
- PLINK
- 7zip

You need to prepare a FTP site to backup to, I created the site on the machine that runs the backup and this way I can zip it up after the backup completes.

just run it once a day and it will keep history for each day.
change each [] field with your values.


===========================================================
echo off
set user=[username]

rd D:\Backup\Fortigate\Temp /s /q
md D:\Backup\Fortigate\Temp

:1st
set pass=[password]
set hostIP=x.x.x.x
set hostName=[Fortigate Name]
set next=2nd
goto start_bk

:2nd
set pass=[password]
set hostIP=x.x.x.x
set hostName=[Fortigate Name]
set next=3rd
goto start_bk

:3rd
set pass=[password]
set hostIP=x.x.x.x
set hostName=[Fortigate Name]
set next=7zip
goto start_bk

:start_bk
echo === Backing up %hostName% at %hostIP% ===
echo execute backup config ftp /fortigate/Temp/%hostname%_%hostIP%.conf [traget ftp ip] [ftp user] [ftp password] > Command.txt
plink -ssh %hostIP% -l %user% -pw %pass% -m D:\Work\Fortigates_Backup\Command.txt
del command.txt /q
echo.
goto %next%

:7zip
Set MONTH=%DATE:~4,2%
Set DAY=%DATE:~7,2%
Set YEAR=%DATE:~10,4%
7z.exe a -r "D:\Backup\Fortigate\FG_%DAY%-%MONTH%-%YEAR%.zip" D:\Backup\Fortigate\Temp\*.*

:end

====================================================================

have fun.

12 May, 2010

IP address convert to full numbers

Hi,

don't know about you but I keep a record of all of my IP on a spreadsheet, did you try to sort them ? - it will sort the 1 and then the 100 numbers because it sees them as test and not numbers.

Created a cool small spreadsheet that helps you convert all your IP to a structure of xxx.xxx.xxx.xxx format.
The GoogleDoc Link

Enjoy.

(By the way, it will work with xxx.xxx at at the start - my all network is 192.168 so...)

11 May, 2010

Delete all snapshots in a SR (XenServer)

Hi,

Wrote a little script to centrally delete all snapshots from a SR on XenServer.
I noticed that although you delete a snapshot an entry still remains on the SR.
Since I have 1 main SR I wrote a script to delete all of them before the backup process begins (later when it will be ready I'll post it).

================================================
echo === deleting old snapshot ===
echo Start at:
echo %date% - %time%
:start
C:\Progra~1\Citrix\XenCenter\xe.exe -s [Pool Master / Server IP] -u [user] -pw [password] vdi-list is-a-snapshot=true sr-uuid=[sr uuid] --minimal > vdi.txt
for /f "tokens=1 delims=," %%G in (vdi.txt) do (
if [%%G] EQU [] goto end
C:\Progra~1\Citrix\XenCenter\xe.exe -s [Pool Master / Server IP] -u [user] -pw [password] vdi-destroy uuid=%%G
echo.
goto start
)

:end
=================================================

and it works great...

06 May, 2010

Resizing a SR on XENServer 5.5

I needed to re-size an SR in XenServer, for some reason all the articles (including the one on citrix web site) did not work.

Finally I did the following steps and it started working...

1. Shut down all virtual machines on the SR.
2. Get the SR UUID with #xe sr-list name-lable=[SR anme]
3. Extend the Volume on the Storage
4. In CLI Run #iscsiadm -m node –R (to reinitialize the iSCSI) on the pool master
5. In the CLI run #pvresize --setphysicalvolumesize 40G /dev/sda1 (when replacing the amount of Gb and the location of the SR)
6. Run in the CLI #xe sr-scan uuid=[uuid]
7. Run #pvs to be sure the new size is here
8. Power on the Virtual Machines.



Simple, no ?

VMWare workstation virtual NIC has no access

Hi,

Had a problem with VMWare Workstation for some time now, started a vm and the nic could not connect to the network, only a restart to my laptop did the trick.

Took me a while to find that this will happen after a hibernation, looked a bit more and found the solution:


=====================================
net stop vmnetbridge
net start vmnetbridge
pause
=====================================

you can run it even if the VM is running and it will fix the NIC problem.

05 May, 2010

Microsoft Online Services Signin application will not resolve the user

Had a problem for a very long time now.
I moved few of my china users from my internal exchange server to use cloud based email provided by Microsoft.

The sign-in application should create a redirection of the auto-discovery service to the online service but it seems that they have a bug in the program, If I use the registry override for use with Closest DC (KB319206) the autodiscover override does not work. (I deployed it due to my multi-site environment).

HKEY_CURRENT_USER\Software\Microsoft\Exchange\Exchange Provider\

Changed the "Closest DC" dward to “0” and all is OK.