Google Drive (Backup and sync) Service

July 21, 2018

Hello guys

Google Drive (now Backup and Sync from Google) desktop software is for personal use & terminates the software execution as soon as the user logs off from the computer. We needed a solution for a server in which we were using Google drive for legacy database backups. Following the instructions @ http://www.myrtec.com.au/kb/331-running-google-drive-as-a-windows-service, we were able to setup a Windows service executing the drive executable, which looked bit dirty from different angles as we were using some stone age software to run the Service.

Then we came across couple of discussions at

https://superuser.com/questions/463801/sync-google-drive-when-not-logged-in

https://stackoverflow.com/questions/20148768/google-drive-as-service-or-background-operation

and, were able to design a far better solution. Here how it works:

Install & setup Google Drive (Backup and Sync) software (your box/Server)

Go to settings & disable “Open Backup and Sync” on system startup

Now, you can safely quit the Backup and Sync software (Right click, quit)

Fire up Windows Task Scheduler and create a task, let us called it “Google backup and sync”

Make sure the tasks runs without the user being logged in.

Depending upon the startup load on the server (If your server/box many services which require maximum memory and processor, delay starting the this new task by few minutes)

It is advisable to setup the startup path for the task. Just copy and paste the executable path.

Most importantly, if you are using a laptop, make sure you are setting up whether the drive sync task should start while the laptop is on battery power.

Once all these settings, you will be asked to provide the current user password. If you have a password policy, remember to change the password for the task once after you change the account password.

That’s all. Right click and execute the task and monitor the task manager, you should see two instances of google drive sync exe file. Now, logging off shouldn’t terminate the google backup and sync.

I hope this post makes it easier for you to setup Google backup and sync for Windows servers.

 

rajesh

Advertisements

Classic ASP with Oracle database 12c 64Bit

July 11, 2018

Hi guys

Yesterday I was contacted by one of the visitors after referring my posts about Classic ASP connection to Oracle databases in general & I revisited this “area” after a long time. It took a while for me to setup everything, however the results were pretty awesome. So here comes one more post about Classic ASP with Oracle database, this time Oracle 12c 64Bit.

OS: Windows 10/64Bit Windows Server OS

Prerequisites

  • Setup IIS for publish classic ASP with Oracle 12c database

Software requirement(s):

  • Oracle client 32Bit, 12c (for best connectivity)

Launch IIS and create a new application pool, as shown with the image.

clip_image002

Now go to the advanced settings for the application pool that you have created & switch “Enable 32-Bit Applications” from “false” to “True”

clip_image004

Connection possibilities

There are two ways to connect to Oracle database from Classic ASP

  1. Using DSN (Data Source Name)
  2. DSN less connections. Here we will use the Oracle tnsnames.ora file to identify and connect to the database. We have to insure that the TNS_HOME directory is set at the environment level, or the client that is used is 1st entry in the environment variable “PATH” for Oracle products in case of multi Oracle homed hosts.

Create a DSN

Classic ASP could interact with only 32Bit environment, hence the IIS server hosting machine must have the latest Oracle 32-Bit client installed (older clients may not connect to later databases properly). As I am writing this post, Oracle 12c 12.2.0 is the latest client available.

Logged with an account having “Administrator” privileges, Open ODBC Data Source (32-bit)

clip_image005

Please note, my box has multiple Oracle products, hence don’t get confused by the names in next few screens.

clip_image007

If your installation for the Oracle client was correct, you should able to see an entry for the Oracle driver like the one you could see the image above.

Click “Finish”. This will pop up another window. Under the “System DSN” tab we have to create our new DSN

clip_image008

Provide a name of your choice for the “Data Source Name” and “Description”

Make sure you have the “TNS Service Name” already available with the listener.ora file. Oracle 12c passwords are case sensitive. Hence make sure you are going to provide the case sensitive password while testing the connection.

If you don’t have previous experiences with creating net service names, please follow the instructions below.

clip_image009

Start “Net Configuration Assistant” from the Oracle Home and follow the images below.

clip_image010

Read the help texts available, especially if you are new to Oracle

clip_image011

Provide the service name, which is your database name usually.

clip_image012

 

clip_image013

Provide the FQDN (fully qualified domain name), ie, your computer name like “rajesh-pc.abc.com” in case if you are connected to a domain, else just the name of your computer, like “rajesh-pc”

clip_image014

I would suggest doing a test, if you are sure that all the details provided are correct & no need to test, you can skip this step

clip_image015

clip_image016

By default the configuration tool would suggest you the Oracle service name as new net service name, which you can change to any name. Just make sure that you will remember it.

clip_image017

clip_image018

Now let us test the new service name we have just created.

clip_image019

Once the Net Service Name is created, we will see both the scenarios using 2 different asp files, both using different connection approaches

(ASP sample was copied from here)

1. Connecting to 12c using DSN


<html>
<head>
<title>Connecting to an Oracle database using ODBC and DSN connection</title>
</head>
<body>
<% 
SET myConn=SERVER.createobject("adodb.connection")
myConn.Open "DSN=BAC;" & _ 
"Uid=APPS;" & "Pwd=APPS" 
SQLStr="SELECT BANK_ID, BANK_NAME, BANK_TYPE FROM BAC_BANKS" 
SET result=adoCon.execute(SQLStr) 
IF NOT result.EOF thEN 
response.write("<h2>Oracle ASP Example</h2>") 
response.write("<p>Connecting to the Oracle11g database using ODBC & without a DSN</p>")
response.write("<table BORDER=3 BGCOLOR=#0099CC><tr><th>BANK ID</th>" & _
"<th>Name</th><th>TYPE</th>") 
WHILE NOT result.EOF 
response.write("<tr><td>" & result("BANK_ID") & "</td>") 
response.write("<td>" & result("BANK_NAME") & "</td>") 
response.write("<td>" & result("BANK_TYPE") & "</td></tr>") 
result.movenext() 
WEND 
response.write("</table>") 
ELSE 
response.write("<p>Error retrieving bank data!!</p>") 
END IF 
adoCon.Close()
%>
</body>
</html>

2. Connecting to 12c without DSN


<%
Dim adoCon 'Holds Connection
Dim rsViewRecords 'Holds Record Set

' Initiate connection

Set adoCon = Server.CreateObject("ADODB.Connection")

adoCon.Open "provider=oraoledb.oracle;data source=SCT;user id=APPS;password=APPS"

if Err.Number <> 0 then
Response.Clear()
response.Write "<hr>ORASESSION Error<br>" & err.number & " -- " & err.Description & "<hr>"
response.End
end if

SQLStr="SELECT BANK_ID, BANK_NAME, BANK_TYPE FROM BAC_BANKS"
SET result=adoCon.execute(SQLStr)
IF NOT result.EOF thEN
response.write("<h2>Oracle ASP Example</h2>")
response.write("<p>Connecting to the Oracle11g database using ODBC & without a DSN</p>")
response.write("<table BORDER=3 BGCOLOR=#0099CC><tr><th>BANK ID</th>" & _
"<th>Name</th><th>TYPE</th>")
WHILE NOT result.EOF
response.write("<tr><td>" & result("BANK_ID") & "</td>")
response.write("<td>" & result("BANK_NAME") & "</td>")
response.write("<td>" & result("BANK_TYPE") & "</td></tr>")
result.movenext()
WEND
response.write("</table>")
ELSE
response.write("<p>Error retrieving bank data!!</p>")
END IF
adoCon.Close()
%>

Hope this helps few “Classic ASP” guys out there ;)

regards,

rajesh


Windows Server 2016 | Remote Desktop will not connect

May 31, 2018

Hi guys

I started this blog when I started using Windows 7 initial release and was struck with end number of issues, mostly related networking.

I am turning my attention towards Windows OS, minimum for a while as I am dealing with another Windows OS, that is crap like no other times…Windows Server 2016, which, looks and feels like Windows 10 with server OS capacities (to certain extends). A totally screwed up Server OS which has half of the settings over modern layout and rest on the legacy

This time I am going to discuss about a peculiar situation that arises once after removing “Remote Desktop Services from Windows Server 2016 & trying to initiate a normal RDP session with the server.

It just won’t connect. That’s all. You check for the usual stuffs everywhere and realize that everything is set fine, firewall, permissions. Yet, you won’t able to connect.

After trying to fix “few” things myself, I gave up and started searching for some answers. One of the most interesting things I learned about Windows Server 2016 is, there are hardly any forums discussing anything at all about this particular OS. 99% of the results I am provided were either for Windows Server 2008  or 2012 & for few situations not a single result for 2016!

Anyway I landed on this thread

https://social.technet.microsoft.com/Forums/en-US/bb34981e-9489-4a0c-80fc-6fdea2cd5cd3/remote-desktop-not-working-after-uninstalling-remote-desktop-session-host-server?forum=winserverTS

& by the bottom of the page found a link to Dell site where a solution was provided for Windows Server 2012 R2 to recreate the RDP-TCP registry values. As I was dealing with a VM, which is already backup, I decided to give it a try

http://www.dell.com/support/article/us/en/04/sln286475/how-to-recreate-or-add-an-additional-rdp-listener-in-windows-server-2012-and-2012-r2?lang=en

I’m copying the instructions here, for the reasons that the above link may not be available after a while.

1. Recreate the default RDP Listener
How to recreate the RDP listener.
1. Export the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
2. Delete the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
3. Copy and paste the below text into notepad, and save the file as RDP-Tcp.reg. Additionally, if the operating system is 2012 R2, another file will be required with the contents of the second box.


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
"fInheritMaxIdleTime"=dword:00000001
"fPromptForPassword"=dword:00000000
"fResetBroken"=dword:00000000
"PdClass"=dword:00000002
"LoadableProtocol_Object"="{5828227c-20cf-4408-b73f-73ab70b8849f}"
"UserAuthentication"=dword:00000001
"fDisableCam"=dword:00000000
"fInheritAutoLogon"=dword:00000001
"InteractiveDelay"=dword:00000032
"Domain"=""
"fInheritReconnectSame"=dword:00000001
"SelectTransport"=dword:00000000
"MinEncryptionLevel"=dword:00000002
"fInheritShadow"=dword:00000001
"WFProfilePath"=""
"fReconnectSame"=dword:00000000
"PdDLL"="tdtcp"
"PortNumber"=dword:00000d3d
"PdFlag1"=dword:00000000
"WdName"="Microsoft RDP 8.0"
"fInheritMaxSessionTime"=dword:00000001
"WdFlag"=dword:00000036
"SelectNetworkDetect"=dword:00000000
"fLogonDisabled"=dword:00000000
"MaxDisconnectionTime"=dword:00000000
"Callback"=dword:00000000
"PdDLL1"="tssecsrv"
"NWLogonServer"=""
"MaxIdleTime"=dword:00000000
"fDisableEncryption"=dword:00000001
"fInheritCallback"=dword:00000000
"fDisableCcm"=dword:00000000
"ColorDepth"=dword:00000003
"PdName"="tcp"
"fEnableWinStation"=dword:00000001
"OutBufLength"=dword:00000212
"PdFlag"=dword:0000004e
"CallbackNumber"=""
"CdClass"=dword:00000000
"Shadow"=dword:00000001
"fDisableCdm"=dword:00000000
"PdName1"="tssecsrv"
"fInheritSecurity"=dword:00000000
"CdDLL"=""
"LanAdapter"=dword:00000000
"fInheritResetBroken"=dword:00000001
"CfgDll"="RDPCFGEX.DLL"
"InitialProgram"=""
"fDisableClip"=dword:00000000
"InputBufferLength"=dword:00000800
"fAllowSecProtocolNegotiation"=dword:00000001
"fDisableAudioCapture"=dword:00000000
"Password"=""
"CdName"=""
"fDisableLPT"=dword:00000000
"CdFlag"=dword:00000000
"PdClass1"=dword:0000000b
"fAutoClientLpts"=dword:00000001
"fAutoClientDrives"=dword:00000001
"fInheritCallbackNumber"=dword:00000001
"OutBufCount"=dword:00000006
"fInheritMaxDisconnectionTime"=dword:00000001
"MaxInstanceCount"=dword:ffffffff
"KeyboardLayout"=dword:00000000
"fDisableExe"=dword:00000000
"AudioEnumeratorDll"="rdpendp.dll"
"Username"=""
"KeepAliveTimeout"=dword:00000000
"fUseDefaultGina"=dword:00000000
"fHomeDirectoryMapRoot"=dword:00000000
"fInheritColorDepth"=dword:00000000
"fForceClientLptDef"=dword:00000001
"WorkDirectory"=""
"SecurityLayer"=dword:00000001
"DrawGdiplusSupportLevel"=dword:00000001
"WdPrefix"="RDP"
"fInheritAutoClient"=dword:00000001
"fDisableCpm"=dword:00000000
"Comment"=""
"OutBufDelay"=dword:00000064
"fInheritInitialProgram"=dword:00000001
"MaxConnectionTime"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\VideoRemotingWindowNames]
"AGFullScreenWinClass"="*"
"MacromediaFlashPlayerActiveX"="*"
"EVRVideoHandler"="*"
"MicrosoftSilverlight"="*"
"ShockwaveFlashFullScreen"="*"

Additional 2012 R2 values:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
"UserAuthenticationBackup"=dword:00000000
"MaxMonitors"=dword:00000004
"MaxXResolution"=dword:00000a00
"MaxYResolution"=dword:00000640

4. Double-click the RDP-Tcp.reg file and click Yes at the prompt.

Now, restart the box & you are back in the game once again.

Try it in case if you are “also” stuck & let me know about your experiences through comments.

regards,

rajesh

 

 

 


Windows Server 2016 | Too early for Production environments

May 30, 2018

Hi guys

Recently for a new hardware, we opted Windows Server 2016, which was suggested by the vendor and our logical thinking that we are already by the mid of 2018 and we should have a recent server OS.

Although we bought the OS, we didn’t use it until our recent Citrix deployment for a legacy application that is 20 years old, based on Oracle forms and reports (Developer 2000 6i)

Everything went as expected, but the printing. 1st of all we were expecting some misconfigurations from Citrix & came to conclusion that we will address the direct printing requirements from the legacy mini ERP by changing few stuffs here and there.

In order to make sure that no mistakes were been made during Citrix implementation causing such a hiccup, I decided to setup a lab environment (Actually the legacy application sources I have and the latest compiled are bearing different time stamps, hence I was skeptical about recompiling those forms after changing the printing routines…)

So I picked up a Windows 2012 R2 physical server, setup Citrix following the documents provided by our implementation partner, which had minutely detailed explanations with screenshots how to install and configure Citrix XenApp 7.15.xx

After setting up the store front, I accessed the published application and the default printer was the one I have as default in my laptop! This caused me more confusion, so I decided to recreate the exact setup once again using Windows Server 2016

I built a VirtualBox VM using evaluation version of Windows Server 2016 standard edition and patched it with May 2015 cumulative update before setting up Citrix. I was able to reproduce the printing issues once again & I decided to find out what was the real cause behind two different behavior between Windows Server 2012 & 2016!

Kept on searching for any kind of information & came across couple of TechNet discussions

 https://social.technet.microsoft.com/Forums/office/en-US/d3bb9c96-d271-4eb4-b544-c2bcdc0f2e66/printer-redirection-server-2016?forum=winserverTS

 &

 https://social.technet.microsoft.com/Forums/en-US/785cbcc6-4f0b-4d88-b12f-2b1d89b85a44/remoteapp-default-printer-redirection-not-working-in-server-2016?forum=winserverTS

I dug deep into the registries of both OS after a normal RDP to confirm that Windows Server 2016 retains local printer for the key “HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows:Device” while Windows Server 2012 maps this key value with the default printer redirected from the client during a RDP session!

1

I couldn’t find a valid explanation or solution for Windows Server 2016, hence asked the implementer to redo the Citrix deployment using Windows Server 2012.

Now the topic cannot be justified just because we had some issues with an outdated legacy technology, should have more

Windows updates: I never experienced such kind of broken stuffs with Windows update that Windows Server 2016. It looks and breaks like Windows 10 & reminds me a BIG mobile phone than a real server OS

Windows Domain Administrator account has “Not enough privileges” to interact with desktop icons & more. This OS is almost 19 months old & Microsoft hasn’t fixed the above “bug” until date, so you could guess what kind of progress they might have had with this particular OS!

There could be more than what I have listed above with the OS that is still half baked. I am sure the printer related issue that I have narrated above MUST be another bug & future releases “may” address it.

So, unless you are true risk taker, I suggest to continue with Windows Server 2012 & only to use Windows Server 2012 in the test/development environments and to avoid straight away going with the OS for production deployments.

regards,

rajesh

 


Unified domain profiler | Software

April 11, 2018

Hi guys

Trust me! throughout the last may years, I made few dozen attempts to “learn” C# systematically. Due to my ever growing responsibilities as IT manager & Oracle applications lead support, always something else came in front as more important and I kept losing the progresses I have ever made with this interesting development stack.

Well, enough said. Today I am going to share a compact software that could generate moderately detailed information about the Windows domain member computers, servers and users from a single console, that I started developing almost 2 years back.

This software helps you to export the fetched details to an excel sheet for future references. While there are no restrictions exclusively available for the software, the source code for the application is ONLY available against written requests. Refer the readme.txt file for more details.

Please download the zip file from this link and extract to a single folder. Double click open “WpfWMI” to run the software (No installations required). We are using open source EPPlus.dll for the excel export and you must insure that the dll file is within the same folder of the executable file (WpfWMI.exe)

Pre-requisites: The computer you are running this software MUST have .Net framework 4.5 installed.

Test it & post your comments and suggestions.

regards,

rajesh


Windows 10 | 0x80070035

April 4, 2018

Update: In my case, I was able to fix the issues by re-installing Windows using the installation media over an existing Windows 10 1709 installation. I chose to keep files and applications and once after the re-installation successfully completed, achieved the desired results.

Update: Basically this is a bug, which doesn’t affect those who were keeping on upgrading from builds to new builds (ie from 15xx to 17xx). Affects most of the users who did clean installation of 1703/1709 which is yet to be addressed by Microsoft. My case, I did an upgrade from 16xx and resetting the TCP/IP, Winsock etc did the damage for me (Well, it realized that, this issue also exists ;) )

Today, I managed to realize that by just unchecking OK, Checking again and OK combinations on File and Printer Sharing Services for the network adapter fixes the dreaded issues until a restart.

12

Here are the workaround solutions until Microsoft finally releases a patch/update for it.

http://partnersupport.microsoft.com/en-us/par_clientsol/forum/par_win/windows10-1703-file-and-sharing-printer-net-view/9569d27f-d979-4c5a-9a01-98cd9c99c4f2?page=2

Other references:

https://social.technet.microsoft.com/Forums/windows/en-US/671fdb58-7d82-4078-a372-e3b50433faa4/windows-file-sharing-stops-after-every-restart?forum=win10itpronetworking

https://superuser.com/questions/443329/windows-7-file-and-printer-sharing-doesnt-work-for-me

 

Hi guys

Recently I tried to enable mobile hotspot on my Windows 10 (1709) Pro machine at work that is a domain member. By the time I figured out that the connection issues clients connected to the ad-hoc network were purely related to some authentication issues with our UTM device…it was too late.

I did enough damage to the network stack of my box, reset winsock, rebuilt TCP/IP, resetting the firewall.. and after fixing the issues with mobile hotspot, started having issues with the HP printer and a particular folder that I share with my team.

Both the printer and shared folder cannot be accessed over network, the funniest part was from my local machine itself I couldn’t access the shared folder by calling it like

\\mymachinename\foldername

So as usual I tried to fix the issues using Windows trouble shooters and all the time I was getting the same info “0x80070035” and further diagnostics gave me:

“The device or resource <<HOSTNAME>> is not set up to accept connections on port “The File and printer sharing (SMB)”.”

I tried to find more details, especially about the above statement and unfortunately, none of the questions asked by users in relation were satisfactorily answered by Microsoft.

Then I landed on a Microsoft page @ https://answers.microsoft.com/en-us/windows/forum/windows_10-networking/windows-10-pc-rejecting-incoming-connections/a36974c7-3208-4489-ad44-962838c38b29

The last contributor asks Is “File and Printer sharing for Microsoft Networks” enabled under the properties of the network card?, for obvious reasons I was sure that this service is enabled under the network properties of my Ethernet device.

Logically, my next approach was to uninstall this service from the adaptor, re-install it. Immediately after reinstalling the service, all the shared assets from my laptop were accessible over the network.

Still not happy, I rebooted the machine, to find out that the shares were once again having the same issue(s).

0x80070035

So I uninstalled and reinstalled the “File and Printer sharing for Microsoft Networks” service and this time reset the Defender Firewall to defaults. Instead of restart I did a shutdown, waited few minutes and restarted it.

As I am drafting this post, I have checked the access it is working perfect. Will reboot one more time to insure that this fix is permanent.

I don’t know the technical reasons behind this erratic behavior, however it looks like one more time uninstalling and installing the “File and Printer sharing for Microsoft Networks” fixes the issues (minimum for now) & until a reboot.

If you are facing the same issue(s), why don’t give it a try.

regards,

rajesh

 

 


USB 3.0 External Drives | A quick alternative when disk reports errors

March 8, 2018

Hi guys

During last few years, majority of the external HDDs were introduced with USB 3.0 ports which were supposed to make the data transfer faster (& they are until everything is OK). However, these interfaces start wrecking the nerves as the disks become old & a user may come across unexplained errors in the long run. One of them being Windows/OS reporting the drive requires scan and repair to proceed. Most of the times this situation leaves the user panicked & repairing activities may error out without any positive results.

So, next time when you are hit with such an error reported by the OS, give the following a try.

Use a USB 2.0 data cable in the place of USB 3.0 data cable. Check the below images to identify the USB 2,3 portions

usb-3

Connect your USB 2.0 data cable to the USB 2.0 portion. Check the below image for a USB 3.0 external HDD that is connected using a USB 2.0 cable for data access.

usb3

Give it a try, it may get back to your very important data!

regards,

rajesh