PowerBI – Number and Currency Formatting

October 31, 2017

After looking for a solution why my Number Formatting did not want to work out…

After creating a new Measure it returned the classing US based formatting.

image

While I wanted to have the EU formatting in my table.

Power BI Desktop Client Regional Setting :

Even after changing the Power BI Desktop Client settings, it did not take effect Sad smile

image

Solutions :

Go to Control Panel –> Region –> FORMAT

image

If this format is not in line with your region it will overrule the Power BI Regional settings ?

image

So after applying the correct region format settings on OS level, everything appeared as expected Smile

PS : These figures are just demo based Winking smile

Enjoy!

Advertisements

PowerShell – Using PoSH SSH Module to access Raspberry Pi3

October 22, 2017

You can use PuTTY to access the RPI3

image

image

Or you can use the PoSH-SSH module to do the same.

So let’s give it a try :

If you connect using this command

New-SSHSession -ComputerName  YourRPI3

Don’t use a domain notification for the user, but just the user name.

image

image

But further then this you can’t get … in this version of PoSH-SSH, so best use the famous PuTTY tool to connect.


PowerShell – Using PoSH SSH Module to access Synology NAS

October 21, 2017

You can now access any SSH device using the PoSH SSH module.

Let’s give it a try using a Synology NAS Device.

Make sure that you enable the SSH Access Service

image

Next make sure you have installed the PoSH-SSH module

Find-Module Posh-SSH

image

Next install it using this command (run as Administrator) :

Find-Module Posh-SSH | Install-Module

After installing you can check the commands available

Get-Command -Module Posh-SSH

image

Now you are ready to make a connection Smile

New-SSHSession -ComputerName YourNASDeviceNAME

image

You can check the session info like this

Get-SSHSession
Get-SSHTrustedHost | fl

image

Let’s run some commands

Invoke-SSHCommand -SessionId 0 -Command "ls -all" | select-Object output -expandproperty output | fl

image

Or using this format :

$result = Invoke-SSHCommand -Index 0 -Command "uname -a; cd /; pwd; ls /volume1" 
$result.Output

image

$result = Invoke-SSHCommand -Index 0 -Command "uname -a" 
$result.Output

image

To stop the session use this command :

Remove-SSHSession -Index 0 -Verbose

image

Enjoy !!


Windows 2016 – Hyper-V installation Issues

October 13, 2017

After installing the Hyper-V feature on a Windows 2016 Server with 1 active NIC.

I got the problem that after the installation I had no network connection anymore …

When I installed it I had remote control over the server that was standing somewhere abroad.

So I lost all connectivity Sad smile 


What went wrong and how to fix it !

When installing the Hyper-V Server Role and Feature, I selected the Network Adapter too.

image

This is where it went wrong… When the server restarted I did not have any network connectivity anymore.

So I had to call someone in locally to uninstall this Feature again, but again you will run into an issue… !

Ones installed one of the problems is that you can’t uninstall the Hyper-V feature anymore.

Using the Dashboard GUI anymore, it will be Grayed Out Sad smile

image

Therefor I started with first removing the Hyper-V Virtual Switch … But no success.

Solution Steps :

Step A :
Deleted Virtual Switch associated with Physical NIC

image

image

Step B :

You need to do this using PowerShell to run this command as Admin

Remove-WindowsFeature -Name Hyper-V


After removing the Feature I still did not have Internet Connectivity ?

Not on LAN and not on Internet ?

Step C :

After activating the second NIC, I gained back network connectivity … Smile

When comparing the 2 NICs setttings.

The one that did NOT connect had the Network Load Balancing (NBL) active.
This must have been activated when installing the Hyper-V feature ?

image

After deactivating the Network Load Balancing (NBL) 

Everything ran again normal…

PS :

if all of this did not work, you can try to go this way.

Deleted the Physical Adapter from Device Management and then Scanned for Hardware changes.

Physical Adapter was found, and settings were back to their original state

Hyper-V on 1 NIC

https://smudj.wordpress.com/2015/05/14/windows-10-hyper-v-setting-up-networking-shared-and-bridged-options/


PowerShell – Database Choise SQLite vs SQLCE

October 12, 2017

 

Over time I wrote some posts relating to SQLCE as a nice standalone Database platform that can by used in PowerShell or Webmatrix on IIS etc.

Now that MS has announced the end of life of Webmatrix Sad smile

“WebMatrix product support ends on November 1st, 2017”

As Webmatrix runs on MSSQLCE we need to look for alternatives…

“MS SQLCE support will end in July 2021”

One of the most obvious alternative is of course SQLite, which is shipped as part of AutoIT Winking smile

 

Besides this, SQLite has much more to offer then SQLCE :

Comparison http://erikej.blogspot.be/2011/01/comparison-of-sql-server-compact-4-and.html

 

As you can see the size limit is 140 TB and unlimited concurrent users !

And it runs on Windows / Linux / Mac … and as well on Mobile devices.

So this will do for a while … Winking smile

 

SOLUTION :

1. Download the appropriate .NET Assembly for your environment

https://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki

2. Run this PS code :

Add-Type -Path "C:\Temp\.NET SQLite Library\System.Data.SQLite.dll" 

$con = New-Object -TypeName System.Data.SQLite.SQLiteConnection
$con.ConnectionString = "Data Source=C:\Temp\.NET SQLite Library\northwindEF.db"

$con.Open()

$sql = $con.CreateCommand()
$sql.CommandText = "SELECT * FROM Customers"
$adapter = New-Object -TypeName System.Data.SQLite.SQLiteDataAdapter $sql
$data = New-Object System.Data.DataSet

[void]$adapter.Fill($data)

"Rows # :  " + $data.tables.rows.count
$data.tables.rows | Out-GridView # | ft

3. Test it.

Once you run it you can access the SQLite Database lightning fast …

 

image

 

Some more Tips and Tools you can find here :

http://erikej.blogspot.be/2014/08/sqlite-toolbox-40-visual-guide-of.html

http://erikej.blogspot.be/2014/11/using-sqlite-with-entity-framework-6.html

Enjoy !


Windows 10 – How to reset Local Administrator Pswd

October 7, 2017

Let’s say you need to get access to a PC that has an Administrator password. But you don’t know it… ?

Solution :

This the simple procedure to get in :

1. Get a Boot CD or a Windows installation CD (Boot USB will do as well)

2. Next start up the Boot CD and go to the CMD prompt

image

3. Go to the the WINDOWS\SYSTEM32\

Rename the UTILMAN.EXEto UTILMAN.BAK

image

4. Copy the CMD.EXE to CMD1.EXE and renmame it to UTILMAN.EXE

Normally the Windows KEY + U combination will bring up this screen before you logon.

image

5. Restart the PC… and press Windows Key + U at logon screen

After the modifications the key combination will bring up the CMD

image

6. Now use this command to add a new Administrat User :

NET USER SUPERADMIN TESTUSER P@$$w0rd /Add

NET USER LOCALGROUP administrators SUPERADMIN /ADD

This will add a new user to with admin rights to the PC to login …

7. Use this command to activate the built in Administrator or reset the password.

NET USER Administrator P@$$w0rd /Add

NET USER Administrator activate:yes

image


Windows 10 – Offline Files not Available (Where did the Online Button Go ?)

October 4, 2017

In windows 7 using the file Explorer you could a button to work back online when you have been offine.

Example after making a VPN connection to your home base, you could switch to work online for all offline files and folders.

In Windows 10 this feature seem to have disappeared ?

But not realy ….

Solution :

Once you are offline first connect back using a VPN connection to your server….

And in the File Explorer go to EASY ACCESS  next click work OFFLINE ?

This is the confusing part… even if you are working offline you need to click it again Smile

image

You can monitor the status bar of the file eplorer at the bottom it should change to ONLINE

image

the funny part is that the label of the Butto Work Offline will never change to ONLINE Confused smile

If this does not work in your case you can try to add this registry key, reboot and try again….

Add : SilentForcedAutoReconnect

image

It did work in my case Smile

Enjoy !!