06 May, 2010

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.

29 April, 2010

Symantec Backup Exec remote agent manual update

Hi,

I had problems with remote updating BackupExec remote Agent, some update went OK but others just failed.
Symantec will not give an easy way to manually deploy those updates and when they multiply it's a lot of work...

I found an easy way to it, follow this steps:

1. copy the following folder localy: "\\[BEServerName]\c$\Program Files\Symantec\Backup Exec\Agents\RAWS32\Updates" (RAWS32 should be replaced with RAWSX64 depends on your OS)

2. create a CMD file in that directory and copy the following to the file:

rem ===== this will list all BE Agent updates in dates order and will apply them ====
dir /OD /B *.msp > files.txt

for /f %%A in (files.txt) do (msiexec /update %%A /passive /norestart)

rem ==== the end (easy no ?) =====

3. run the CMD file...

08 March, 2010

Notepad++ run the script with cscript

Hi,

I needed a way to run a vbs script i was working on using Notepad++ and I all the time had to go to a cmd screen and run it.
Found a cool way to ease my pain, in the "Run" menu there is an option to save a command. Just type the following and a CMD window will open and will run the vbs in cscript.

=================================================================
cmd /k cd /d "$(CURRENT_DIRECTORY)" && Cscript "$(FILE_NAME)"
=================================================================

if you would like to leave the window open each time use the following:
=================================================================
cmd /c cd /d "$(CURRENT_DIRECTORY)" && Cscript "$(FILE_NAME)" && pause
=================================================================

Bye...

04 March, 2010

reset the offline files and configuration

Just had hard time finding a solution for Offline files that the server is no longer sharing the files.
Very simple:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\NetCache" /v FormatDatabase /t REG_DWORD /d 1 /f

Restart the machine and reconfigure the sync...

10 February, 2010

New User Home directory auto-creation

Hi,

New users always come and you do the same things a lot of times.
I wrote a script to simplify the creation and permissions of new user directories.

Just multiply the script for any new personal directory (this one include 2 directories):
=================================================================
echo off
cls
echo This batch will create and set ACL on PST and home Drive
echo.
echo Please type the new user name:
set /P C=

if exist \\server1\pst$\%C% goto pst_exist
echo The pst folder will be created
pause
echo.
md \\server1\pst$\%C%
cacls \\server1\pst$\%C% /E /G "%C%":C
goto check_Homefolder

:pst_exist
echo the PST directory already exist, please check
pause
echo.

:check_Homefolder
if exist \\server2\users\%C% goto H_exist
echo The Home Folder folder will be created
pause
echo.
md \\server2\users\%C%
cacls \\server2\users\%C% /E /G "%C%":C
goto end

:H_exist
echo the Home Folder directory already exist, please check


:end
pause

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

02 February, 2010

auto backup of active directory gpo

Hi,

This script will automatically backup all GPO in your AD environment, also it will check for errors and mail you about them (with the log file).

First install GPMC.

My sample is using the following:
- 7Zip exe
- Mailit exe
- d:\work\gpo (where the scripts are)
- d:\backup\gpo (where the backup is)

the script:
==================================================
rd D:\Work\GPO_Backup\Temp /s /q
md D:\Work\GPO_Backup\Temp
cscript "C:\Program Files\GPMC\Scripts\BackupAllGPOs.wsf" D:\Work\GPO_Backup\Temp > log.txt
find /i "Backup failed for 0 GPOs" log.txt
if %errorlevel% NEQ 0 goto error
goto OK

:error
echo error in GPO backup
rem === mailit parameters ===
SET MAILIT_SERVER=mail.server
SET MAILIT_FROM=GPO_bk@yourdomain.com
SET MAILIT_TO=s@yourdomain.com
SET MAILIT_SUBJ=Error in GPO Backup
SET MAILIT_MSGTEXT=There are errors in GPO backup, see attached log.
SET MAILIT_ATTACH=D:\Work\GPO_Backup\log.txt
D:\Work\GPO_Backup\MAILIT.exe
goto end

:OK
Set MONTH=%DATE:~4,2%
Set DAY=%DATE:~7,2%
Set YEAR=%DATE:~10,4%
7z.exe a -r "D:\Backup\GPO\GPO_%DAY%-%MONTH%-%YEAR%.zip" D:\Work\GPO_Backup\Temp\*.*
if %errorlevel%==0 goto end

rem === mailit parameters ===
SET MAILIT_SERVER=mail.server
SET MAILIT_FROM=GPO_bk@yourdomain.com
SET MAILIT_TO=s@yourdomain.com
SET MAILIT_SUBJ=Error in GPO Backup (7zip)
SET MAILIT_MSGTEXT=There are errors in GPO backup (7zip)
SET MAILIT_ATTACH=
D:\Work\GPO_Backup\MAILIT.exe
goto end



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