Tips & tricks Utils

Lista com compilação de algumas entidades de multibanco úteis:

omo saber a quem pertence uma entidade / referência MB de pagamento de serviços?

read more »

Code Snippets SQL



%a    Abbreviated weekday name (Sun-Sat)
%b    Abbreviated month name (Jan-Dec)
%c    Month, numeric (0-12)
%D    Day of month with English suffix (0th, 1st, 2nd, 3rd, ?)
%d    Day of month, numeric (00-31)
%e    Day of month, numeric (0-31)
%f    Microseconds (000000-999999)
%H    Hour (00-23)
%h    Hour (01-12)
%I    Hour (01-12)
%i    Minutes, numeric (00-59)
%j    Day of year (001-366)
%k    Hour (0-23)
%l    Hour (1-12)
%M    Month name (January-December)
%m    Month, numeric (00-12)
%p    AM or PM
%r    Time, 12-hour (hh:mm:ss followed by AM or PM)
%S    Seconds (00-59)
%s    Seconds (00-59)
%T    Time, 24-hour (hh:mm:ss)
%U    Week (00-53) where Sunday is the first day of week
%u    Week (00-53) where Monday is the first day of week
%V    Week (01-53) where Sunday is the first day of week, used with %X
%v    Week (01-53) where Monday is the first day of week, used with %x
%W    Weekday name (Sunday-Saturday)
%w    Day of the week (0=Sunday, 6=Saturday)
%X    Year for the week where Sunday is the first day of week, four digits, used with %V
%x    Year for the week where Monday is the first day of week, four digits, used with %v
%Y    Year, numeric, four digits
%y    Year, numeric, two digits

The following script uses the DATE_FORMAT() function to display different formats. We will use the NOW() function to get the current date/time:

DATE_FORMAT(NOW(),’%b %d %Y %h:%i %p’)
DATE_FORMAT(NOW(),’%d %b %y’)
DATE_FORMAT(NOW(),’%d %b %Y %T:%f’)

The result would look something like this:

Nov 04 2014 11:45 PM
04 Nov 14
04 Nov 2014 11:45:34:243

Azure Microsoft Office365

Azure Password Sync

Check your synchronization user security tab, or in domain properties if “Replicating Directory Changes” and “Replicating Directory Changes All” is checked.

Microsoft Windows server

OEM Windows Server 2016 Core Licensing Calculator

Below you will find a link to the OEM licensing calculator for Windows Serer 2016 Standard and Datacenter.

OEM Windows Server 2016 Core Licensing Calculator (.XLSX)


Secret Codes for Android Phones

The main functionality of having secret codes hidden within a mobile device was originally intended for the employees of the respective devices to trouble shoot and perform procedures. Yet now, living in a digital world, everyone has access to this information.

read more »

Microsoft Windows server

How to setup Active Directory (AD) In Windows Server 2016

Windows server 2016 is the upcoming server operating system from Microsoft scheduled to be release sometime around the 3rd quarter of 2016. In this tutorial I will go through step by step on how to install the Active Directory ( AD ) role on Windows Server 2016. If you are setting up the server for production is recommended to set a static IP address on the server before you start the AD installation. Also before you start the AD installation, rename the server now if you need to, once you have installed the AD role on the server, it is not easy to change the name without breaking a lots of things.

read more »

Exchange Office365 Tips & tricks

Emails between O365 and On-premises do not work

Error message: 451 4.4.0 Primary target IP address responded with: “451 5.7.3 Must issue a STARTTLS commnd first” Office 365 Hybrid

In some scenarios you might need to, in your firewall:   Disable Content Inspection with TLS


more about in:

Code Snippets Microsoft Networking Tutorials

How to find a Global Catalog server?

With DNS Requests (NSLOOKUP)

In an Active Directory environment, all Global Catalogs are anchored in DNS . There is a separate subdomain ‘GC._msdcs ….’ in the namespace of the AD root domain (please remember: the global catalog does not refer to individual domains, but to the entire forest). So if your root domain in the forest is e.g. example.root, then you get a list of all GCs with this command:

C:\> nslookup gc._msdcs.example.root

Server:  dns01.example.root

Name:  gc._msdcs.example.root

The container _msdcs contains the infrastructural DNS records of the Active Directory. This is also where all the SRVservice records for the domain controllers are stored.


You can also use the standard command line tool DSQUERY for searching GCs. The search can be limited to certain domains or AD sites. However, you must be authenticated in the regarding forest and DSQUERY must be available on your machine (this is usually the case on Widows servers). As a result, the server objects in the Configuration partition is displayed:

C:\> dsquery server -isgc


C:\> dsquery server -isgc -domain ""

C:\> dsquery server -isgc -site "Site-Auckland"

Per Script with an LDAP filter
In the last section we have seen that the global catalog servers are present in the configuration partition of the directory as specific objects. Her we can look for them with our own script. These servers have set the first bit in their ‘options’ attribute. All we need is the appropriate LDAP filter:

ldapFilter = "(&(objectClass=nTDSDSA)(options:1.2.840.113556.1.4.803:=1))"

Set rootDSE = GetObject("LDAP://rootDSE")
configDN =   rootDSE.Get("configurationNamingContext")

Set ado = CreateObject("ADODB.Connection")
ado.Provider = "ADSDSOObject"
ado.Open "ADSearch"
Set objectList =   ado.Execute("<LDAP://" &configDN& ">;" & ldapFilter & ";distinguishedName;subtree")

While Not objectList.EOF
nTSDSA = objectList.Fields("distinguishedName")
serverDN = Mid(nTSDSA, 18)                                         'CN=NTDS Settings abschneiden => Server Objekt
Set serverObj = GetObject("LDAP://" & serverDN )

WScript.Echo serverObj.dNSHostName




Microsoft Networking

How Do I Find A List Of Global Catalog Servers Using Nslookup?

The following commands will list all Global Catalog Servers in your Active Directory domain:

  1. From the command prompt, type nslookup.
    • C:\nslookup
  2. Set the type to server.
    • >set type=srv
  3. Find the Global Catalog Server(s).
    • >_gc._tcp.<DnsForestName>
  4. Example:
    •  >_gc._tcp.“your”
  5. The results will include the hostname and IP address of each Global Catalog Server.
  6. Type “exit” to leave the nslookup session.


Tutorials Utils VB Visual Studio

Default certificate could not be created. Publish aborting

You need to tell the Publisher where to get the Certificate from:

  1. Go to Project-> Properties
  2. Go to the tab named “Signing”
  3. Check the Checkbox labeled ‘Sign the ClickOnce manifests’. This enables the section where you can point to a certificate.
  4. Click on the button labeled ‘Select From File…”. In the directory listing, choose a key file (.pfx) and Open.
  5. From the step 3, click the button labeled “More Details…”. This will display the certificate you’ve just selected.
  6. Click “Install Certificate” and follow the prompts.
  7. Save and Publish your Solution.