13 July, 2015

Check if name equals its IP via batch

Hi,

Had a problem that I had a server name and it's IP and needed to make sure that the IP did not change.

Here is a small script to do that, pass the name and IP as parameters and it will give you back errorlevel according to the check (0 for OK).

============================================================
FOR /f "tokens=1,3 delims=: " %%A IN ('ping -n 1 %1') DO IF %%A==Reply set ip=%%B

If %2==%ip% goto ok

exit /B 1

:OK

exit /B 0
============================================================


Enjoy

29 January, 2015

creating m3u playlist automatically

Hi,

I'm updating my USB stick very frequently and the new car I got does not allow folder browsing only playlists. - very annoying.

But, this is not something that will stop me... after a lot of testing a created the following script, it will create a M3U file in each sub-directory (for now it only works with one level down).

So, there is PlayListCreator-Step1.cmd:
==========================================
del *.m3u /S /Q
dir /B /AD >DirList.txt

for /f "tokens=*" %%A in (DirList.txt) do (PlayListCreator-Step2.cmd "%%A")
==========================================

And PlayListCreator-Step2.cmd:
==========================================
set root=%__CD__%
cd %1
dir /b /o:n *.mp3 > "%~1.m3u"
cd /d %root%
==========================================

Just save the content between the === to files and run PlayListCreator-Step1.cmd.


Enjoy...

30 December, 2014

Find PDC emulator via nslookup query

Hi,

Just wanted to find a fast way to find who has some DC roles in the domain, sure there is the way to go into the MMC console but a fast way (and without the need to rdp the DC or install remote management tools) is running a nslookup query.

So, just open CMD and fill in the blanks:

Find all DC's:
nslookup -type=SRV _ldap._tcp.[your.fqdn.domain]

Find the PDC Emulator run:
nslookup -type=SRV _ldap._tcp.pdc._msdcs.[your.fqdn.domain]


Due credit for this site...

28 October, 2014

Simple script to check for firewall cluster failover

Hi,

I thought that you may like a very simple (but powerful) script to check if your firewall filed over to the standby node.

The script is made from 3 files:

  • active_fw_ip.txt
  • standby_fw_ip.txt
  • Checked_FailOver_FW.cmd
The first 2 files contain exactly what they mean, each one has the IP of the active / standby firewall, to know what IP to save in the file just run a tracert command and see what is the IP that the fw is using. (if not ask your network guy).

Next, save the following content to Checked_FailOver_FW.cmd file:

************************************************************

rem *** get last check details ***
set /p active_fw_ip=
set /p standby_fw_ip=
set checked_ip=172.19.1.201

rem *** execute check ***
tracert -d -h 2 %checked_ip% | findstr "%active_fw_ip%"
if %errorlevel% == 0 goto All_OK else 
goto ip_changed

:All_OK
echo Nothing Changed...
goto end

:ip_changed

rem *** check if failover happened or something else ***

tracert -d -h 2 %checked_ip% | findstr "%standby_fw_ip%"
if %errorlevel% == 0 goto FailedOver else 
goto Error_in_check

:FailedOver
rem *** update files ***
echo %standby_fw_ip% > active_fw_ip.txt
echo %active_fw_ip% > standby_fw_ip.txt

echo echo FW Failed Over !!!

rem *** Here you put
rem *** any alerts
rem *** you may want
rem *** for a fail-over

goto end

:Error_in_check

rem *** Probebly check did not go OK ***
echo Check did not executed OK, check...

rem *** Here you put
rem *** any alerts
rem *** you may want
rem *** for a failed check


:end
************************************************************

just fill in the action you want taken when the firewall failed over or when the check did not go well.

Enjoy.


[from several checks that I did it seems that the script will work only if the firewall that you check is your default gateway... sorry...]

16 September, 2014

Add checkbox to a word document (v2013)

It seems that adding checkbox to a word document is not that easy, the option is not there by default.
So here it is (not that hard after all):

Open The option menu
Go to "Customize Ribbon" and check the "Developer" on the right side

Next just stand in the document where you need the check box to be and move to the "Developer" tab there you could find all kind of controls, one of them is the checkbox.


Enjoy...



15 September, 2014

no more cleanfreebusy switch in Outlook 2013

Hi,

Just encountered a feature change I think you should be aware of.

Although microsoft writes that Outlook supports the /CleanFreeBusy switch (http://office.microsoft.com/en-us/outlook-help/command-line-switches-for-outlook-2013-HA102606406.aspx) they removed this option for outlook 2013 due to no free/busy information in public folders anymore (http://technet.microsoft.com/en-us/library/cc178954%28v=office.15%29.aspx)

You will get the following error:



Will try to find a solution and update you if something comes up..

09 September, 2014

Save Password related settings removed from GPP and Tasks

Hi,

Security, Security...

I found now that Microsoft found that saving passwords is risky and removed this feature from the settings.

The direct affected settings are:

  • GPP Drive Maps
  • GPP Local Users and Groups
  • GPP Scheduled Tasks
  • GPP Services
  • GPP Data Sources
  • Scheduled Tasks

No words...

The possible solutions are:
  1. workaround the issue with scripts
  2. Uninstall the update KB2928120 or /and KB2961899



Enjoy the uninstall...