Category Archives: Microsoft

Laravel custom Authentication, With Microsoft Dynamics NAV Odata Webservice (table Customers)

I was created one project with laravel 5.4 and custom authentication to one table of Dynamics NAV (2017) trough web services, these are the steps that I was make to do this:

  • I was folow some steps As this article explains perfectly: CustomUserProvider.php 
      • Modify config/auth.php:
            'providers' => [
                'users' => [
                    //'driver' => 'eloquent',
                    'driver' => 'customuserprovider',
                    'model' => App\User::class,
                ],
        
                // 'users' => [
                //     'driver' => 'database',
                //     'table' => 'users',
                // ],
            ],
        
      • but then Modify providers/AuthServiceProvider to use my own customuserprovider:
         <?php namespace App\Providers; use Illuminate\Support\Facades\Gate; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider { /** * The policy mappings for the application. * * @var array */ protected $policies = [ 'App\Model' => 'App\Policies\ModelPolicy',
            ];
        
            /**
             * Register any authentication / authorization services.
             *
             * @return void
             */
            public function boot()
            {
                $this->registerPolicies();
                // added to modify auth provider that's the trick
                 \Illuminate\Support\Facades\Auth::provider('customuserprovider', function($app, array $config) {
                return new CustomUserProvider($app['hash'], $config['model']);
                    });
                //
            }
        }
        
Facebooktwitterredditpinterestlinkedinmail

Read More ...

LINQ to XML Group by C# alternatives

The problem:
I have a xml variable Xdocument in C# like this:

I want to do a “group by” all the same records:

Facebooktwitterredditpinterestlinkedinmail

Read More ...

Hyper-V error 800700B7

Hyper-V failed to enable replication for virtual machine ‘xxx’ : Cannot create a file when that file already exists. (0x800700B7). Virtual machine ID 27bxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx

Replication scenario :

Consider my primary server is A and replica server is B. Replication is running A to B. There are one VM replicating from A to B. I have tried to resume replication both the VMs but replication is not resumed. So first i have removed replication from A and From B for those two VMs. Then removed VM from B and respective folder of VM (folder name on ‘VM ID’).

I am getting this error while i am enabling the replication again as it was disturbed so i need to re-enable it. But getting upper error. I have removed the replication and deleted the VM folder from replica. still it is showing as above and not enabling the replication.

The Solution:

Find in all folders on the destination server for the virtual machine ID:  “27bxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx”

I found one folder in :”Undolog Configuration” that can not delete , then I restart  the “Hyper-V Virtual Machine Management Service” and can delete it.

 

Facebooktwitterredditpinterestlinkedinmail

Read More ...

Exchange 2010 checklist after installation

Hi Guys!

this is a list of common tasks to do after a tipical Exchange installation for an small-medium Bussiness

  • Enable Circular logging: (normaly you need to do it for prevent disk filling up)

  • Don’t forget to configure limits for mailboxes:

  • A common mistake is to not assing a offline address book on the database

  • About Hub transport, you need to create a send connector to send mail

  • especially set message limits (remember to do it in all connectors send and receive)

  • On the client connectors you need to increase message size limits, for a lot of times errors on sincronization off outlook clients is for this reason
  • I was a bad experience about this, becose outlook not sincronizes messages bigger than this limit.

  • If you want to configure the exchange server with basic authentication (SMTP) on port 25,  you have to disable the higlighted option:

  • If the exchange is a front-end server, that receives messages for a domain, you have to allow anonymous Users on the Default Receive connector

  • If you want to configure POP3 or IMAP access,

  • If you want to use basic port and basic authentication, enable the higlighted option:

  • Remember to change the Services (POP3 and IMAP4) to automatic startup.

  • For OWA and Activesync, remember to inform the external url of your server

  • After install you may be experience the error on the Outlook clients (oflline address book) the famous =”0x8004010F”, this is becose the offline address book is created on 5:00 am by default:

  • You can wait for next day or if you want to create it manualy , you can do this:

1. Run Update-OfflineAddressbook “offline address book”  in Exchange Management Shell. e.g

Update-OfflineAddressbook “Default offline address book”

2. Restart System Attendant Service on the OAB Generation Server (Mailbox Server). This service is responsible for generating the OAB by communicating with Active Directory infrastructure.

3. Either run following command in EMS

Update-FileDistributionService “CASServerName”

or just restart File Distribution Service on CAS Server.

File distribution service copies the OAB from the Mailbox Server, where System Attendant Service puts OAB in a shared folder “C:\Program Files\Microsoft\Exchange Server\ExchangeOAB”. Outlook clients then download the OAB from CAS published OAB Virtual Directori

  • Another tipical error is “Unable to relay” when clients authenticated to SMTP server from outside organization, you can do this to solve:

To enable any authenticated user to relay as any address, run the following powershell, changing the connectors name for yours:

Add-AdPermission -Identity “Default Receive Connector” -User “NT AUTHORITY\Authenticated Users” -ExtendedRights ms-Exch-SMTP-Accept-Any-Sender

more information at this link: http://www.colome.org/scripts/exchange/49-5-7-1-unable-to-relay-exchange-2010-for-external-authenticated-users.html

Facebooktwitterredditpinterestlinkedinmail

Read More ...

List all ip address from one computer

Simple way To get all ip directions of one pc,

 On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
 Set colItems = objWMIService.ExecQuery 	("Select * from Win32_NetworkAdapterConfiguration")
cadena=""
For Each objItem in colItems
	For Each strIPAddress in objItem.IPAddress
		cadena=cadena &amp; " " &amp; strIPAddress
	Next
Next
Wscript.Echo cadena
Facebooktwitterredditpinterestlinkedinmail

Read More ...

Categories

Subscribe to my Newsletter




By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close