Windows7bugs | Script Copying Instructions

November 9, 2014

Hello guys

Once in a while we receive complaints about scripts copied from our blog causing issues. We regret those issues and apologizing to everyone who suffered due to. Our blog is totally free until date and unfortunately, different browsers behave differently while parsing the code tags.

We were using

 [ code ] [ /code ]

tag for long time, found that few scripts getting totally messed up with double quotes being showsn and &quote etc. This has forced us to start using

[ sourcecode ] [ /sourcecode ] 

and realized if we have more than one block of scripts, the 2nd and consecutive scripts blocks being totally garbled.

With reference to above said, we request you to kindly make sure that the scripts those you copy from our posts are thoroughly checked for special characters prior applied. Especially registry related scripts as such attempts could completely wreck your Windows registry databases.

We hope you read us clearly and continue supporting us.

Regards,


Oracle 10g | Get Windows User Details from Active Directory

December 9, 2014

Hello guys! 9th December 2014 : Minor update The following exercise will not materialize if you have a middleware sever, as the client information will not be available for your forms. Missed us? :) Recently we were challenged with a very interesting task, and that was to send emails to the requester of a particular activity once after the completion. Usually, we can look into the HR/Payroll enrollments and get the email address for the user without much troubles. Our case was different, our HR/Payroll records are not always up to date and we were forced to capture the Windows login name and get the email addresses straight away from the AD database! As usual, after hours of googling and trying out few scripts, We came up with a tailored script that fetches us the full Name and email address against value derived from

Select sys_context('userenv','os_user') from dual;

query Here, we are sharing the scripts with you Complete credits go to the following few & many others http://www.dba-oracle.com/t_packages_dbms_ldap.htm http://oracle-base.com/articles/9i/ldap-from-plsql-9i.php (Our script is a complete rip-off from oracle-base.com article)

/* Formatted on 12/9/2014 2:56:10 PM (QP5 v5.163.1008.3004) */
SET SERVEROUTPUT ON SIZE UNLIMITED;
 
DECLARE
   /*This block commented never worked for us
      -- Adjust as necessary.
      --   l_ldap_host    VARCHAR2(256) := 'server01.tshcomputing.com';
      --  l_ldap_port    VARCHAR2(256) := '389';
      --  l_ldap_user    VARCHAR2(256) := 'cn=orcladmin';
      --  l_ldap_passwd  VARCHAR2(256) := 'password';
      --  l_ldap_base    VARCHAR2(256) := 'cn=Users,dc=tshcomputing,dc=com';
   */
 
 
   --Active Directory Component Windows 2008 R2
 
   l_ldap_host     VARCHAR2 (256)
                      := 'fully qualitifed name of your domain controller'; --eg (abc-efg@xyz.com)
   l_ldap_port     VARCHAR2 (256) := '389';
   l_ldap_user     VARCHAR2 (256) := 'fully qualified user name'; --eg: paul@xyz.com (make sure paul is a member of Administrators group)
   l_ldap_passwd   VARCHAR2 (256) := 'password'; -- clear text password for user paul@kazema.com
   l_ldap_base     VARCHAR2 (256) := 'DC=xyz,DC=com';
   -- l_ldap_base     VARCHAR2 (256) := 'OU=GEN Managers,DC=xyz,DC=com'; --Restrict the query to a particular OU within AD
   --AD 2008 R2
 
 
 
   l_retval        PLS_INTEGER;
 
   l_session       DBMS_LDAP.session;
   l_attrs         DBMS_LDAP.string_collection;
   l_message       DBMS_LDAP.MESSAGE;
   l_entry         DBMS_LDAP.MESSAGE;
   l_attr_name     VARCHAR2 (256);
   l_ber_element   DBMS_LDAP.ber_element;
   l_vals          DBMS_LDAP.string_collection;
BEGIN
   -- Choose to raise exceptions.
   DBMS_LDAP.USE_EXCEPTION := TRUE;
 
   -- Connect to the LDAP server.
   l_session := DBMS_LDAP.init (hostname => l_ldap_host, portnum => l_ldap_port);
 
   l_retval :=
      DBMS_LDAP.simple_bind_s (ld       => l_session,
                               dn       => l_ldap_user,
                               passwd   => l_ldap_passwd);
 
 
   -- l_attrs(1) := '*'; -- Get all attributes(Complete AD details will be read, use carefully)
 
   l_attrs (1) := 'mail';
   l_attrs (2) := 'displayName';
 
   --Common Attributes you can pass to the AD query
   --  l_attrs(1)  := 'sAMAccountName';
   --   l_attrs(2)  := 'employeeNumber';
   --    l_attrs(3)  := 'displayName';
   --    l_attrs(4)  := 'description';
   --    l_attrs(5)  := 'telephoneNumber';
   --    l_attrs(6)  := 'facsimileTelephoneNumber';
   --   l_attrs(7)  := 'department';
   --   l_attrs(8)  := 'company';
   --    l_attrs(9)  := 'employeeID';
   --   l_attrs(10) := 'streetAddress';
   --   l_attrs(11) := 'mail';
   --   l_attrs(12) := 'c';
   --  l_attrs(13) := 'l';
   --   l_attrs(14) := 'postalCode';
 
 
   -- retrieve all attributes
   l_retval :=
      DBMS_LDAP.search_s (ld         => l_session,
                          base       => l_ldap_base,
                          scope      => DBMS_LDAP.SCOPE_SUBTREE,
                          --          filter   => 'objectclass=*', --All the objects will be read
                          filter     => 'sAMAccountName=paul', --Record for User with windows login account as "Paul" will be fetched
                          attrs      => l_attrs,
                          attronly   => 0,
                          res        => l_message);
 
   IF DBMS_LDAP.count_entries (ld => l_session, msg => l_message) > 0
   THEN
      -- Get all the entries returned by our search.
      l_entry := DBMS_LDAP.first_entry (ld => l_session, msg => l_message);
 
     <<entry_loop>>
      WHILE l_entry IS NOT NULL
      LOOP
         -- Get all the attributes for this entry.
         DBMS_OUTPUT.PUT_LINE ('---------------------------------------');
         l_attr_name :=
            DBMS_LDAP.first_attribute (ld          => l_session,
                                       ldapentry   => l_entry,
                                       ber_elem    => l_ber_element);
 
        <<attributes_loop>>
         WHILE l_attr_name IS NOT NULL
         LOOP
            -- Get all the values for this attribute.
            l_vals :=
               DBMS_LDAP.get_values (ld          => l_session,
                                     ldapentry   => l_entry,
                                     attr        => l_attr_name);
 
           <<values_loop>>
            FOR i IN l_vals.FIRST .. l_vals.LAST
            LOOP
               DBMS_OUTPUT.PUT_LINE (
                     'ATTIBUTE_NAME: '
                  || l_attr_name
                  || ' = '
                  || SUBSTR (l_vals (i), 1, 200));
            END LOOP values_loop;
 
            l_attr_name :=
               DBMS_LDAP.next_attribute (ld          => l_session,
                                         ldapentry   => l_entry,
                                         ber_elem    => l_ber_element);
         END LOOP attibutes_loop;
 
         l_entry := DBMS_LDAP.next_entry (ld => l_session, msg => l_entry);
      END LOOP entry_loop;
   END IF;
 
   -- Disconnect from the LDAP server.
   l_retval := DBMS_LDAP.unbind_s (ld => l_session);
   DBMS_OUTPUT.PUT_LINE ('L_RETVAL: ' || l_retval);
END;
/

Try it & let us know the experiences! regards,


Do you want to learn VB.net & C# along with us?

December 7, 2014

Greetings from Kuwait guys!

Whole the last many years we were mostly concentrating on Oracle related technologies, as we mostly use those technologies at work. Right now we are planning to shift our main business application to something that is built solely using Microsoft development platform .Net & starting a new category adhering to the same.

We are not at all experts in this development platform, however, as we “hacked” the Oracle technologies for our requirements, will keep on trying to do the same with our relatively new challenge .Net!

Stay tuned, we are sure, we will amuse with our experiments :)

regards,

for Windows7bugs

rajesh


How to get a computer by computer view of installed software using the MAP toolkit

November 23, 2014

As an Administrator maintaining Windows domains, one of the herculean tasks usually one run into is to make a software asset inventory. There are plenty of excellent software to do the job for you, obviously for some cost.

Here we are suggesting you a cheaper alternative, using Microsoft’s own MAP toolkit. Be ready to sweat a bit, and we are sure you would love the outcome.

The entire write up is copied from Microsoft blog and tested by us for assuring, if you follow the instructions as given, within few hours of time you will have a neat software inventory list.

The original link is here

One of the most frequent questions we get at MAPFDBK@microsoft.com is how to get a list of the software discovered by the MAP toolkit on a computer by computer basis.  Most of the users who ask are using this to help them answer a licensing question but it can be used in a number of other scenarios as well for example Software Asset Management or user profiling for VDI (see http://blogs.technet.com/b/mapblog/archive/2012/07/09/planning-for-desktop-virtualization-with-the-map-toolkit-7-0-4-of-4.aspx).

In MAP 7.0, provided this information through a database view and Microsoft Excel.  The name of the view is InstalledProducts_view.

In MAP 8.0, this view has been renamed to [UT_WinServer_Reporting].[InstalledProductsView].

This view contains several key pieces of information that you can use to do a number of things including:

  • Understand what applications and versions are installed throughout your organization
  • See the Operating Systems on which these apps are running and whether the machine is physical or virtual
  • See who is using the machines on which the apps are running
  • Get important license related information such as processor counts, total cores and logical processor counts

To get started, you will need to open Excel and connect to your local SQL Server database that is storing the MAP data that you want to view.  There are two different ways to connect, depending on the version of SQL Server that you are using.

Using your own SQL Server instance

If you are using your own instance (the non-default MAP install), you will select the Data option on the Excel ribbon and select the ‘From other sources’ option.  Then select ‘From SQL Server’.

image_thumb6

Enter your server name and instance name and click ‘Next’.

image_thumb5

Select the database that contains the data you want and then pick InstalledProducts_view row under ‘Name’ for databases created with MAP 7.0.

For MAP 8.0, use [UT_WinServer_Reporting].[InstalledProductsView].

image_thumb7

You can also add some additional information to help describe the connection.  Then click ‘Finish’ and select the location where you want the query results to populate.

image_thumb9

Using the default (LocalDB) instance

In MAP 7.0, the default database installed moved to SQL Server 2012 LocalDB.  There are a couple of steps that are different than those used in other versions of SQL Server.

First, make sure that you have the SQL Server 2012 Native Client installed.  You can get it from

http://www.microsoft.com/en-us/download/details.aspx?id=29065.

With Excel open and the Data ribbon highlighted, select the ‘From other data sources’ option and select ‘From Data Connection Wizard’

image_thumb12

Select the ‘Other/Advanced’ option.

image_thumb13

Then select the option for SQL Server Native Client 11.0 as highlighted below.  If this option is not available, make sure that you have the native client installed – http://www.microsoft.com/en-us/download/details.aspx?id=29065.

image_thumb15

Next, you enter in the server name.  If you are using the default install the server name will be: (localdb)\maptoolkit.

Set the option in #2 to Use Windows NT Integrated Security

Hit ‘Test Connection’

image_thumb18

If you’ve done it correctly, you will get a success message!

image_thumb21

Then follow the same steps as above where you select the database name and the InstalledProducts_view for 7.0.  For 8.0, use [UT_WinServer_Reporting].[InstalledProductsView].

Populate the results in your spreadsheet!

What do I do next?

Well – that is entirely up to you.  One thing that we like to do is to create a pivot table and drill down into this information. Here is one that I created.  I filtered down the application name to include only those that had SQL Server components.  I could look at this by physical/virtual and by operating system.

Pretty cool – huh!

image_thumb23

As a reminder, here is a link to some valuable MAP community supported content.

Enjoy!


Install Oracle 10g (10.2.0.3 onwards) on Windows 10 (Technical Preview)

October 6, 2014

We know it is too early, still as usual we are kicking in once again trying to install Oracle 10g onwards databases on an OS that’s in the early stages of testing/improvements.

If you are wondering whether Oracle 10g (10.2.0.3 onwards) could be installed on Windows 10 (TP), the shortest answer is yes and as usual the earlier hacks what we specified with http://windows7bugs.wordpress.com/2010/02/18/install-oracle-10g-onward-database-developer-on-windows-7/ are still valid for the installation on Windows 10 TP

All you need to do is to add an entry to the refhost.xml file like following:

<CERTIFIED_SYSTEMS>
<OPERATING_SYSTEM>
<VERSION VALUE=”5.0″/>
<SERVICE_PACK VALUE=”1″/>
</OPERATING_SYSTEM>
<OPERATING_SYSTEM>
<VERSION VALUE=”5.1″/>
<SERVICE_PACK VALUE=”1″/>
</OPERATING_SYSTEM>
<OPERATING_SYSTEM>
<VERSION VALUE=”5.2″/>
</OPERATING_SYSTEM>
<!–Microsoft Windows Vista–>
<OPERATING_SYSTEM>
<VERSION VALUE=”6.0″/>
</OPERATING_SYSTEM>
<!–Microsoft Windows 7–>
<OPERATING_SYSTEM>
<VERSION VALUE=”6.1″/>
</OPERATING_SYSTEM>
<!–Microsoft Windows 8–>
<OPERATING_SYSTEM>
<VERSION VALUE=”6.2″/>
</OPERATING_SYSTEM>
 <!–Microsoft Windows 10–>
    <OPERATING_SYSTEM>
      <VERSION VALUE=”6.4″/>
    </OPERATING_SYSTEM>
</CERTIFIED_SYSTEMS>

You may safely ignore the warnings (if any) and proceed with the Installation. Please note, as usual we warn you not to install unsupported databases on newer Operating Systems as you may risk with your valued data. Below, few screen shots from our installation attempt which was successful.

1

2

3

You will be prompted to install .NET Framework 3.5 (That includes .NET 2.0 and 3.0), and we suggest you install it for better stability of the database

4

6

7

8

That’s all folks

for Windows7bugs

rajesh


Install Windows 10 Technical Preview on Oracle Java VirtualBox

October 2, 2014

This is our first post after months long break. As Microsoft has released the technical preview for their forthcoming OS “Windows 10” we are once again engaging ourselves to try out “Uncertified” Oracle products over a possibly half cooked OS in the preview state.

Scenario:

Host: Windows 8.1 64Bit Professional

Intel i5, 8GB Memory, 1TB HDD (Dell E6420 14” laptop)

Java VirtualBox 4.3.16 r95972

image

We will try explain how to install Windows 10 Technical Preview on VirtualBox in next few steps

Windows 8.1 comes with Hyper-V enabled default. If you are planning to try out the 64Bit version of technical preview, make sure you disable Hyper-V from “Windows features”

image

Uncheck the Hyper-V & restart the computer when prompted.

In order to download the Technical preview you must signup for Windows Insider Program (http://windows.microsoft.com/en-us/windows/preview)

We are sure, if you are an enthusiast wanting to try out the preview, you are already a half geek, who knows how to signup something very straight forward like “Windows Insider”

Download your choice of technical preview, 32Bit or 34Bit ISO file. The file is on disk is 3.81GB, so if you have a slow connection, start download, have a nap. We are on a 12MBPS fiber connection and it took around 50 minutes for the download to finish!

image

Start Oracle VirtualBox now

image

Create a new Virtual Machine (Follow the images)

image

Based on available memory on your computer, setup the maximum memory you can allocate for the VM. We suggest a minimum 4GB for better performance

image

Create a virtual drive now, minimum 20GB is recommended

image

Complete the Virtual Disk creation based on your preferences (eg: location, VDI or VMDK)

We just created a new VM, however remaining are few more settings. Let us analyze what kind of choices were made by VirtualBox for our new VM until.

General

9

System

Change the number of processors to 2, if you have more cores.

11

Finally load your ISO file to the IDE controller.

12

Save the changes by clicking “Ok” and let us start the VM finally, thus initiating the installation process

13

Based on the language selection you made prior downloading the ISO file, you will be prompted to start the installation after couple of minutes waiting

14

Follow the prompts and Select “Custom” installation while prompted.

15

Rest assured, wait for the installation to complete.

16

We opted to go with “Express settings” for the installation

17

You will be asked to sign in with a Microsoft Account next, just select “Create a new account”, that will allow you to “Sign in without a Microsoft Account” option

18

Once a local account created, you will go through the same Windows 8/8.1 setting up procedure, stay calm

19

That’s it folks, now you have completed the installation of Windows 10 Technical Preview using Oracle VirtualBox!

It’s time to click on the “Start Menu” button Winking smile

21

for Windows7bugs

rajesh


Windows |Rotate your display

August 4, 2014

 

Once in a while, awkwardly you press a combination of keys and all of sudden your display is upside down or either by right or left side and you are baffled without an idea how to bring it back to the normal position? Here is the magic key combination

CTRL+ALT+UP Arrow Key (Normal position)

image

Try the following ones

  1. CTRL+ALT+Down Arrow key (Inverted/upside down)
  2. CTRL+ALT+Left Arrow Key (Taskbar by your right side vertical)
  3. CTRL+ALT+Right Arrow Key (Taskbar by your left side vertical)

Enjoy

rajesh


Follow

Get every new post delivered to your Inbox.

Join 53 other followers