30 March, 2026

Long time... How to fix subtitles files for hebrew (Plex)

 So I upgraded my Plex and suddenly my Hebrew SRT files started showing as gibberish.

I looked for an answer and found a script (I cannot find the site I took it from so, my apologies for the original author of the script).

It was not exactly what I was looking for so I adjusted it and below is my final version.

Just save it as PS1 and put it in the root directory of your movies/TV directory, it will test the files to find the files it need to fix, create a new converted file and delete the old one.

All of the actions are written to a log file.

Here it is:

22 September, 2016

Get Local Administrators group members for all servers in the domain (Powershell)

Hi,

Could not find a script that will enumerate all servers from AD (or specific OU) and give me a centralized CSV output of all the members of the servers local administrators group.

So I wrote one...

The script also enumerate groups members and indicate if the object is a user / computer or group (and then write the group name).
The script also check if the server is reachable and if you can connect via WMI, if nor indicates it in the output.
Console output is available.

Enjoy.

========================================
import-module ActiveDirectory

cls
$array = @()
$test2 = ""

#get local admin function
function get-localadmin {
param ($strcomputer)

$admins = Get-WmiObject win32_groupuser –computer $strcomputer -EV Err -EA SilentlyContinue
$admins = $admins |? {$_.groupcomponent –like '*"Administrators"'}

$admins |% {
$_.partcomponent –match “.+Domain\=(.+)\,Name\=(.+)$” > $nul
$matches[1].trim('"') + “\” + $matches[2].trim('"')
}
}

#list all servers to proccess [replace this with your OU structure]
$Comp = Get-ADComputer -SearchBase 'OU=Servers,dc=domain,dc=local' -Filter '*' | Select -Exp Name

#run on each server
foreach ($ADServer in $Comp) {
    #Test if the server is responsive
    $test = Test-Connection -computername $ADServer -Count 1 -Quiet
    Write-Host "`nProccessing " $ADServer "..." -NoNewLine
    If ($test -eq "True") {
            #run the WMI command and catch errors
            Try { $FnLocalAdmins = get-localadmin $ADServer }
            Catch {
                Write-Host " WMI error`n"
                $test2 = "Error"
                $Properties = @{Server=$ADServer;Admin="WMI Error";Type="Error"}
                $Newobject = New-Object PSObject -Property $Properties
                $array += $newobject
                }
            foreach ($Admins in $FnLocalAdmins) {
                #split the username form the domain or server
                $split = $Admins.Split('\')
                $domain = $split[0]
                $usr = $split[1]
                #Check if the object is local or domain based [Replace this with your domain name]
                If ($domain -eq "YOUR_DOMAIN") {
                    $u = Get-ADObject -Filter {samaccountname -eq $usr} -Properties objectClass
                    #check if the object is user, computer or group
                    Switch ($u.objectclass) {
                        User {
                            $Properties = @{Server=$ADServer;Admin=$usr;Type="Domain"}
                            $Newobject = New-Object PSObject -Property $Properties
                            $array += $newobject
                            ;break}
                        Computer {
                            $Properties = @{Server=$ADServer;Admin=$usr;Type="Computer"}
                            $Newobject = New-Object PSObject -Property $Properties
                            $array += $newobject
                            ;break}
                        Group {
                            $g = get-adgroupmember $usr -recursive
                            foreach ($groupuser in $G) {
                            $Properties = @{Server=$ADServer;Admin=$groupuser.samaccountname;Type=$usr}
                            $Newobject = New-Object PSObject -Property $Properties
                            $array += $newobject }
                            ;break}
                        Default {
                            $Properties = @{Server=$ADServer;Admin=$usr;Type="Bad Object"}
                            $Newobject = New-Object PSObject -Property $Properties
                            $array += $newobject
                            ;break}
                    }
                }
                Else {
                        $Properties = @{Server=$ADServer;Admin=$usr;Type="Local"}
                        $Newobject = New-Object PSObject -Property $Properties
                        $array += $newobject
                }
            }
                #write back to the console that all went ok
                If ($test2 -eq "Error") {$test2 = ""} Else {
                Write-Host " OK"
                $test2 = "" }
    }
    Else {
        Write-Host " Unreachable`n" -NoNewLine
        $Properties = @{Server=$ADServer;Admin="Unreachable";Type="Error"}
        $Newobject = New-Object PSObject -Property $Properties
        $array += $newobject
    }
}  
          
#export the results to a csv file
$array | export-csv -Path "D:\Scripts\Server\Output\LocalAdmins.csv" -Delimiter ";" -NoTypeInformation -Encoding UTF8

28 April, 2016

Simple logoff script with cancel prompt and timeout

Hi,

I looked for a way to logoff my kids session on my home PC and it seems that you only have it on Active Directory settings...

So I wrote a VB script and scheduled it to run under my kids username everyday at 23:00...

This will prompt the user if he wants to cancel the logoff and if not answered in 30 seconds (you can change it) will logoff.

Scheduled it for 23:00, 00:00, 01:00 ......

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

Option Explicit
Dim objShell, intLogoff, strLogoff

set objShell = CreateObject("WScript.Shell")
intLogoff = (objShell.Popup("Cancel logoff ?",30,"Logoff",0))
If intLogoff = 1 Then
'Abort Logoff
'Wscript.echo "Login off Canceled"
Else
'Logging off
'Wscript.echo "Login off"
strLogoff = "logoff"
set objShell = CreateObject("WScript.Shell")
objShell.Run strLogoff, 0, false
End if

Wscript.Quit

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

Enjoy...

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...

01 September, 2014

I just became a Devolutions expert...

Hi,

I'm proud to say that I just became a Devolutions Expert, it is a close group of IT experts (only 10 was picked from all the world) who should help the Devolutions community.


I hope I can keep the expectations...

10 August, 2014

Free way to clean outlook contacts duplicates

Hello,

there are a lot of tools to remove duplicates outlook contacts but they are all (from what I looked) either free and do not work or work but costs money.

I found a free way to clean those duplicates.


  1. Download GO Contact Sync Mod
  2. Create or use a Gmail account for the settings of the program
  3. Sync all the contacts to Gmail by selecting the "Outlook to Google Only" setting option
  4. In Gmail go to contacts and then use the duplicate tool to clean the duplicates
  5. Sync all the contacts back to Outlook by selecting the "Google to Outlook Only" setting option (making sure that "Sync Deletion" is selected)

That's it, you are free from duplicated...


Snir


13 July, 2014

How to create a windows service that listen to a TCP port

Hello,

I've been looking for quite a while now for a way to create a windows service that just answer on a TCP port that I configure, didn't needed it to do anything just answer...
I needed it to utilize our F5 load balancer in a way that our help desk guys could remove a server from the pool by stopping a windows service.

So, the searches ended here is the recipe for the windows service TCP port answerer:



The Ingredients:
1 iperf.exe from https://iperf.fr
1 command line
1 registry settings

How to:
First Download the files and save them in a local directory (lets say "C:\TCP_Service").

Then, run he following command:

sc create TCP_Service binPath= "C:\TCP_Service\srvany.exe" start= auto

You can replace the TCP_Service string (after the "create" word) with any name you want (you can run sc create /? for more options)

Then save the following lines between the "====" as a parameters.reg

=========================================
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TCP_Service\Parameters]
"AppParameters"="-s -p 1234"
"Application"="C:\\TCP_Service\\iperf.exe"


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

You can change the location and port (here it is 1234) to what ever you like (the location is the same location of the srvany.exe file from the previous step.

Double click on the parameters.reg file and answer yes to all.

Run services.msc and you will see a new service named TCP_Service, start it.
Open cmd and type: telnet 127.0.0.1 1234

see that it connects...


Enjoy...

13 April, 2014

More efficient clould backup

Hi,

Following my last post on Using Syncovery and Amazon to backup your data to the cloud I moved to Google Drive sync.
I still use Syncovery as my windows sync tool and I use DriveSync on my android.
The low price caught my attention - 2$ for 100Gb per month, the lowest (reliable) could backup I found.


Have a good backup...

Snir

24 February, 2014

Unable to browse to \\tsclient\c path

Hi,

I tried to browse the \\tsclient\c path when connected via RDP with drive mapping in the client

I could not find the mapping, after a lot of searched it seems that the client had NoDrives restriction and if your drives are hidden you would not get mapped via RDP.
All settings can be on user based (Registry - HKCU, GPO - User Configuration)


Hope it helps...

12 January, 2014

Finally a media player to inherit kmplayer

Hi all,

for years I used kmplayer as my media player, in the last year after panda TV bought it it started to brake down. started to be heavy and uses web advertisement - just hell.
I looked and looked but could not find any player with all the features.
A second prob'em I had was windows 8 tablet I started using 2 months ago, it seems that no one thought about a very good player for windows tablet.
And then came PotPlayer, this is a full featured player much like kmplayer but with more benefits like "touch" section for tablets.
Here are some options and configuration screenshots:

Main Screen:

Touch features:


Right-Click on main screen:







 Preferences window:






You can download it from Download.com (don't use the auto-update feature)

Update (13/4/14): 
  • more current version is available at http://www.dvbsupport.net/ (event more updated than the "check for update feature)
  • In the latest update they added more touch features...




15 February, 2013

Get machine IP via script (and check if it's up)

Hi,

I encountered a problem, I have a list of servers from AD and wanted to get the IP on each server.
It seems that this is not easy, I could not find a clean way to do it on the web.

As a batch fan I wrote a small script that get's, as an input, a list of names, ping them and echo out to a file the name and the IP (so you can import it to excel easily).

You need to prepare a file named list.txt with all the names to convert to IP.

Next, create 2 files:

STEP1.CMD
========================================

del pinged_list.txt /q
for /f %%A in (list.txt) do (step2.cmd %%A)
========================================

STEP2.CMD
========================================

ping %1 -n 1 -w 1| find "TTL=" > 1.txt
if %errorlevel% NEQ 0 goto end

for /f "tokens=1-3 delims= " %%A in (1.txt) do (echo %%C > 2.txt)
for /f "tokens=1-3 delims=:" %%A in (2.txt) do (echo %1, %%A >>pinged_list.txt)
del 2.txt /q

:end
del 1.txt /q
=========================================

run step1.cmd and wait to the pinged_list.txt file to be prepared.

Enjoy...

26 January, 2013

Add RDP ver 7 support on Windows 2003 server

RDP version 7 is not available for 2003 server.
and what is you really need it ?

Here is the way:

copy from a windows 2008/7 the following files to directory named "source":

aaclient.dll
aaclient.dll.mui
msrdpwebaccess.dll
mstsc.exe
mstsc.exe.mui
mstscax.dll
mstscax.dll.mui
tsgqec.dll
tsgqec.dll.mui
tswbprxy.exe
wksprt.exe
wksprt.exe.mui
wksprtps.dll

copy the content of the following batch file and save it in a directory above "source":
===========================================



Echo copy RDP 7.0 Files for Windows 2003

Rem Copy to Windows\system32\en-US

copy /y ..\Source\aaclient.dll.mui %windir%\system32\en-US\aaclient.dll.mui
copy /y ..\Source\mstsc.exe.mui %windir%\system32\en-US\mstsc.exe.mui
copy /y ..\Source\mstscax.dll.mui %windir%\system32\en-US\mstscax.dll.mui
copy /y ..\Source\wksprt.exe.mui %windir%\system32\en-US\wksprt.exe.mui
copy /y ..\Source\tsgqec.dll.mui %windir%\system32\en-US\tsgqec.dll.mui


Rem copy to Windows\system32

copy /y ..\Source\aaclient.dll %windir%\system32\aaclient.dll
copy /y ..\Source\MsRdpWebAccess.dll %windir%\system32\MsRdpWebAccess.dll
copy /y ..\Source\mstscax.dll %windir%\system32\mstscax.dll
copy /y ..\Source\tsgQec.dll %windir%\system32\tsgQec.dll
copy /y ..\Source\wksprtPS.dll %windir%\system32\wksprtPS.dll
copy /y ..\Source\mstsc.exe %windir%\system32\mstsc.exe
copy /y ..\Source\TSWbPrxy.exe %windir%\system32\TSWbPrxy.exe
copy /y ..\Source\wksprt.exe %windir%\system32\wksprt.exe
 

Rem copy to Windows\system32\cache

copy /y ..\Source\aaclient.dll %windir%\system32\dllcache\aaclient.dll
copy /y ..\Source\MsRdpWebAccess.dll %windir%\system32\dllcache\MsRdpWebAccess.dll
copy /y ..\Source\mstscax.dll %windir%\system32\dllcache\mstscax.dll
copy /y ..\Source\tsgQec.dll %windir%\system32\dllcache\tsgQec.dll


Rem Register Dll after copy

call %systemroot%\system32\regsvr32.exe /s %systemroot%\system32\mstscax.dll
call %systemroot%\system32\wksprt.exe /RegServer
call %systemroot%\system32\regsvr32.exe /s %systemroot%\system32\wksprtPS.dll
call %systemroot%\system32\regsvr32.exe /s %systemroot%\system32\MsRdpWebAccess.dll
call %systemroot%\system32\mstsc.exe /RegServer
call %systemroot%\system32\TsWbPrxy.exe /RegServer


Rem Registry Add (if you have a problem just make sure every line begins with "reg add")

REG ADD "HKLM\SOFTWARE\Microsoft\Internet Explorer\Low Rights\ElevationPolicy\{B43A0C1E-B63F-4691-B68F-CD807A45DA01}","AppName",,"TSWbPrxy.exe"
REG ADD HKLM\SOFTWARE\Microsoft\Internet Explorer\Low Rights\ElevationPolicy\{B43A0C1E-B63F-4691-B68F-CD807A45DA01}","AppPath",0x00020000,"%systemroot%\system32"
REG ADD HKLM\SOFTWARE\Microsoft\Internet Explorer\Low Rights\ElevationPolicy\{B43A0C1E-B63F-4691-B68F-CD807A45DA01}","Policy",0x00010001,3
REG ADD HKLM\Software\Microsoft\Internet Explorer\ActiveX Compatibility\{9059f30f-4eb1-4bd2-9fdc-36f43a218f4a}","Compatibility Flags",0x00010001,0x400
REG ADD HKLM\Software\Microsoft\Internet Explorer\ActiveX Compatibility\{9059f30f-4eb1-4bd2-9fdc-36f43a218f4a}","AlternateCLSID",,"{971127BB-259F-48c2-BD75-5F97A3331551}"
REG ADD HKLM\Software\Microsoft\Internet Explorer\ActiveX Compatibility\{7584c670-2274-4efb-b00b-d6aaba6d3850}","Compatibility Flags",0x00010001,0x400
REG ADD HKLM\Software\Microsoft\Internet Explorer\ActiveX Compatibility\{7584c670-2274-4efb-b00b-d6aaba6d3850}","AlternateCLSID",,"{6A6F4B83-45C5-4ca9-BDD9-0D81C12295E4}"
REG ADD HKLM\Software\Microsoft\Internet Explorer\ActiveX Compatibility\{4EDCB26C-D24C-4e72-AF07-B576699AC0DE}","Compatibility Flags",0x00010001,0x400
REG ADD HKLM\Software\Microsoft\Internet Explorer\ActiveX Compatibility\{4EDCB26C-D24C-4e72-AF07-B576699AC0DE}","AlternateCLSID",,"{54CE37E0-9834-41ae-9896-4DAB69DC022B}"
=====================================================

run the batch file and now you have RDP ver 7 on Windows 2003 server.

It is redundant to write that this is not supported by either Microsoft or me...

Thanks for Elad on this hack.

Enjoy.


01 August, 2012

Using Syncovery and Amazon to backup your data to the cloud


How to get the cheapest on-line backup solution

Well, using Amazon S3 and Syncovery…

Just to say at first, I do not sell or get payed from either amazon nor syncovery for writing this blog.

The first time fee will be 60$ for the Syncovery software and depends on how much data you need to upload to Amazon, from my experience 30Gb is around 4$.

The monthly fee will be about 1.5$ if you do not have a lot of changes.
The pricing can be found at http://aws.amazon.com/s3/pricing/

Now, follow this steps:
1.       Browse to http://aws.amazon.com and get an account for the S3 service (you will have to give your credit card number for the monthly payment…)
2.       Make sure you are in the S3 section
3.       Create a bucket, name it whatever you like but it needs to be unique. As a proposal use the same start and different ending, for example: abcdefg.pictures for the pictures backup bucket and abcdefg.documents for the documents bucket.
Very important – the bucket name is case sensitive so make sure you know what you wrote.
4.       Then click on your name on the upper right corner, on the drop down menu select "Security Credentials"
 

You may be asked to re-login to AWS.
5.       On the section named "Access Credentials" copy the following and save for later:
a.       Access Key ID
b.      Secret Access Key

6.       Browse to http://www.syncovery.com
a.       Download the latest edition
b.      Buy the professional edition for 60$
7.       Create a new profile (we will back up the pictures folder in this example)
a.       Profile Name is "S3 Pictures"
b.      On the "Left-Hand Side", choose your source folder you want to backup (you can also click on "Browse" and do a customized selection)
c.       Next click on "Exact Mirror"

d.      Just to be on the safe side I keep all deleted files for extra 14 days before I delete them from Amazon, click on "Configure"  and fill the following:


You can leave them as long as you like it will not cost you more…
e.      Now on the "Right-Hand Side" click on "Internet" and configure the following:
                                                               i.      Protocol: Amazon S3
                                                             ii.      Bucket:  the bucket name from section 3
                                                            iii.      Make sure that "Reduced redundancy" is checked, it will be cheaper that way.
                                                           iv.      "Access ID" and "Secret Key " should correspond to the details you saved in section 5.

                                                             v.      Now you should see on the Right-Hand Side something like S3://abcdefg.pictures
8.       Now for the fine tuning:
a.       Schedule – schedule the job to run every x time. You need to know that Amazon is charging by the requests and not so much for the size (very smart…) so if you will schedule the job to run every 2 minutes the monthly payment will be higher.
I scheduled it to run every 3 hours…


You have the option to use real-time monitoring, I didn't use it but it seems like a killer option.
b.      Access & Retries – just choose "Do not use" under Volume Shadowing, had a bit of a problem with that feature, not because of the program but due to windows bugs…
c.       Mask & Filters – here you can exclude in general (by mask)
d.      Safety – check the following:

You do not need to worry if your files are deleted because we have 14 days of backup left on Amazon…
9.       Make sure you do not have files larger than 512Mb, if so change the program setting to allow them in the "Rsync, S3" Tab in the Program Settings.
10.   If you want you can configure an email to be sent to you when the backup has problems:
a.       Open Program Settings
b.      Go to Notify Tab
c.       Configure the following checkboxes to get only errors

d.      Click on "Email settings" on the bottom
e.      With your mail address
f.        Assuming that you have a Gmail account hit the "Use Gmail" button and enter your credentials in the "User ID" and "Password" fields.

 That’s it you are ready to start the initial sync…