A little something about everything

internet marketing and website development made simple..

Change Style for Multiple Elements onClick: getElementById, getElementsByClassName, querySelectorAll oh my

With a bit of creative javascript and these Methods you can do some pretty neat stuff.

On this page I've create an example for multiple elements display block/none function based onclick function. You could also utilize checkbox.checked, onmouseover, or other such functions.

You can replace querySelectorAll with getElementsByClassName or getElementById for broader browser support or you can simply create a detector onload to look for an element on the page and hide it if the Method is supported with querySelector like this:

window.onload = function(){
 document.querySelector('#compat').style.display = 'none';
    }

The Code:

HTML

<div class="aa" style="display: block;">class: aa, no id</div>
<div class="aa" id="aa" style="display: block;">class: aa, id: aa</div>
<div class="bb" style="display: block;">class: bb, no id</div>
<div id="aa" style="display: block;">no class, id: aa</div>
<a onclick="showClass('.aa');" href="#">Looks for class: aa</a>
<a onclick="showClass('#aa, .bb');" href="#">Looks for class: bb, and id: aa</a>
<a onclick="showClass('.aa, .bb');" href="#">Looks for class: aa, bb</a>
<div id="compat" style="display:block;position:absolute;width:100%;height:100%;background-color:#fff;top:0;left:0;padding:50px; "><h1>Compatability Error!</h1>
<p>This page uses newer coding technologies. You should consider upgrading your browser.</p>
<p>for suggestions, please go <a href="http://outdatedbrowser.com/en">here</a>.</p>
<a href="#" onClick="document.getElementById('compat').style.display = 'none';">Continue Anyways</a>

Javascript

function showClass(s){
 var e = [];
 var e = document.querySelectorAll(s);
 for (var i = 0; i < e.length; i++){
    if(!e[i])return true;

    if(e[i].style.display=="none"){
       e[i].style.display="block"
    } else {
       e[i].style.display="none"
    }
 }
 return true;
}

Use your imagination and see what you can do with it.

Here is a working example:

class: aa, no id
class: aa, id: aa
class: bb, no id
no class, id: aa
Looks for class: aa Looks for class: bb, and id: aa Looks for class: aa, bb

Compatability Error!

This page uses newer coding technologies. You should consider upgrading your browser.

for suggestions, please go here.

Continue Anyways

VPN setup for Windows Server 2012, How to:

VPN Server Setup in Windows Server 2012

 

Simple walkthrough of the steps you need in order to accomplish this are as follows:

  • Open Server Manager > Add roles and features > Next > Choose (default) role based or feature based > Next
    • Select the server you would like to install VPN services to > Next
    • Select Remote Access Role > Add features > Next > Next > Next
    • Choose (Default) DirectAccess and VPN (RAS) > Next > Next > Next > Install > Close
  • In Server Manager select Remote Access > Select more on the right of the configuration notice or select from you pending tasks
    • Select open getting started wizard if you choose the first method.
    • Select Deploy VPN Only
    • Once the Routing and Remote Access MMC is up right click the Server and choose "Configure and Enable Routing and Remote Access". > Next
      • Select Custom > Next > VPN Access > Finish > OK > Start Service
    • right click server and choose properties
      • Select IPV4 tab to configure IP Pool or leave it Dynamic
  • From Computer management or Active directory you will need to create a group or modify each user you would like to have access to the VPN
    • right click user > properties > dial-in tab > allow access > apply > ok

You should also properly setup you VPN security if you have any critical data being transmitted via this network. For assistance with this you can contact a professional IT company like Area51.mn to assist you with proper setup and network security.  

Microsoft Exchange RPC Client Access fails due to high memory usage in Microsoft® SharePoint® Search Component (aka noderunner.exe) on Exchange 2013

After installing exchange 2013 and migrating clients over to the server you may notice Microsoft® SharePoint® Search Component or noderunner.exe running multiple instances with high memory usage. This is because Microsoft has integrated parts of sharepoint into exchange 2013. This process runs when accounts are first migrated and periodically to index email data stores for OWA in order to make search results fast, very fast.

You can disable Microsoft Exchange Search Host Controller service if it is causing an issue. In some cases it can consume an extremely high amount of memory causing the "Microsoft Exchange RPC Client Access" to fail and get stuck in a starting state. In which case the best solutions are to:

  • Increase the amount of RAM on the server.
  • Set the server to restart when "Microsoft Exchange RPC Client Access" fails. 
  • Disable the "Microsoft Exchange Search Host Controller service".

This is an obvious flaw in the design of exchange 2013 server.

How to setup windows 2012 Domain Controller / Active Directory

After installing windows server and completing the standard windows updates, follow these simple steps.

  1. Verify you have a static IP and networking setup.
  2. Open Computer Management
    1. Update/Change the computer administrator account
    2. restart
  3. Open Server Manager
  4. Select Local Server
    1. Update Computer name and workgroup
    2. restart
  5. Add roles and Features
    1. Select Active Directory Domain Services, accept popup
    2. Select DNS Server
    3. Next -> Install
    4. Once complete, from notifications select "Promote this server to a domain controller" option.
    5. Select add a new forest and input your domain name,
    6. Next
    7. Select function level or leave default if you have no older servers that you plant to connect
    8. pick a DSRM password
    9. Next -> Install
    10. The computer should reboot itself now

Setup should now be complete.

Using a SSL Certificate for RDP

Create and install a certificate using IIS or import a pfx file, the cert can be SHA256 or whatever you want.

Open your Cert Manager,

  • Run/open "MMC"
  • File, Add/Remove Snap-in, Certificates, OK
  • Expand the folder with your cert (generally Personal, Certificates)
  • Right Click the Certificate, Open
  • Details tab, near the bottom choose thumbprint and select the HASH VALUE
  • remove the spaces from the HASHVALUE
  • open a Command Prompt with elevated privileges
  • run the following command using your SSL cert's thumbprint hash value in place of "HASHVALUE" remove the quotes.
    • wmic /namespace:\\root\cimv2\TerminalServices PATH Win32_TSGeneralSetting Set SSLCertificateSHA1Hash="HASHVALUE"
  • It should say "Updating property(s) of ...
  • then it should say .. update successful

That's it, you're done.