Friday, September 20, 2019

Forgot your Wifi Password - Thank you Reddit

If you ever forget your WiFi password or you want to get your school WiFi password etc. Just type this command into the command line of a computer already connected to that WiFi: netsh wlan show profile WiFi-name key=clear

Wednesday, September 04, 2019

Automated test gives us greater confidence that the software is working as it should!

Tools needed for Visual Studio for proper testing with NUnit

1. NUnit3TestFramework (Core or .NET Framework)
2. NUnit3TestAdapter (Core or .NET Framework)
3. Microsoft.NET.Tests.SDK



Wednesday, August 21, 2019

MEAN - MongoDB, Express, Angular, NodeJS

MEAN Development

M - MongoDB - https://www.mongodb.com/
E -  Express - https://expressjs.com/
A - Angular - https://angular.io/
N - NodeJS - https://nodejs.org/en/

IDE of Choice - https://code.visualstudio.com/

Extensions of Choice for VS Code

- Angular Essentials
- Material Icon Theme

Open VSCODE

Ctrl + Shift + `  Opens Terminal Window

Be sure you have installed NodeJS and Angular

Command for Angular is npm install -g @angular/cli

Use the Terminal to Navigate to cd c:/Users/UserName/Source/Repos

Run

https://angular.io/cli/new  ng-new app-name


... More to come

Angular = Components and Components = Uncoupled and resuability

Always work from the ./src/app

Create new folders following the naming structure

+-app
 - app.component.css
 - app.component.html
 - app.component.ts
 - app.component.spec.ts
 - app.module.ts

For new components create new subfolders in the app folder

+-app
 |
 |
 +-my-dog
 - app.my-dog.component.css
 - app.my-dog.component.html
 - app.my-dog.component.ts
 - app.my-dog.component.spec.ts

Update the app.module.ts 


import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { PostCreateComponent } from './posts/post-create/my-dog.component';

@NgModule({
declarations: [
AppComponent,
MyDog
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }




Wednesday, July 17, 2019

Step by Step gmail filter

How to setup Filters in gmail the easy way.

1. I will use "Vail Resorts Talent"


2. Copy the email for this demo:

3: search what every in my example I am using in:inbox  from:recruiting@vailresorts.com

4. Click Create filter


5. It will show the emails and then like magic they are archived to their folders.

That is how I do it.  


Thursday, May 09, 2019

How to clear SharePoint People Picker suggestion cache

How to clear SharePoint People Picker suggestion cache


If you have been SharePoint Site owner long enough, you would have definitely bumped into task like assigning document permission using SharePoint People Picker.
One of the out of the box SharePoint People Picker features is that it auto caches all previous user entry entered/selected by you.

This cached people picker entity is meant to help you to quickly find the user and assign the permission.
It would introduce invalid entry if there is cease of identity provider (for whatsoever reason that the decision made from the IT management needs us to swing the SharePoint identity provider to other platform).
Things could get messier for those who frequently accessing people picker, to be seeing the old cached user.
Another situation that introduce inconsistency is when there is change of user name/job title etc for which is cached and not reflecting the correct info to the end user.

SharePoint People Picker uses LocalStorage to cache the people picker entity. In order to flush the cache, you would need to run a JavaScript to clear the cache. What’s worst is that there is no expiration set.
If you fire up your browser development tool and type in “localStorage” (case sensitive) in the console. You would see the cache key/value for ClientPeoplePickerMRU.
hit F12: For Chrome, IE and Firefox (Note:You must be firing up the developer tool at the SharePoint Page)

Chrome – Resource tab


So what can we do?
If you are developer and techie, you can easily fire up the developer console of your browser and run the below JavaScript
1
localStorage.clear();
If you are helping your end user to flush the cache, one possible way is to provide them a quick custom web part using javascript above to flush their cache. Alternatively, creating a custom JS with leveraging Cookie as expiration check, put it into your home page. Whenever user accessing to your home page, this JS will check from Cookies to see if it is time to Refresh (or clear) the local storage.
The other possible way is to get them clear the Local Storage from their Browser. I couldn’t find where the IE local storage is. If you know, I will be more than happy if you can tell me.
For IE Users who wish to clear the people picker. Here are the steps you may follow
1. Go to page with people picker
2. F12 Developer Tools
a. Console
b. localStorage.clear();
3. Close F12
4. Then refresh the web page to test it.
[Credit goes to Chris for the steps above]

Wednesday, May 01, 2019

GitHub --set-upstream

git push --set-upstream https://github.com/moojjoo/PlunkerNGClick.git master

git pull

git commit -m 'Another commit'

git push

Wednesday, March 20, 2019

Nice AdSearch by LanID to populate a form

$('#Domain_ID').focusout(function () {
    $.ajax({
        type: 'GET',
        url: 'https://localhost:44364/api/v1/AdSearch?userId=rdanne1',
        dataType: 'json',
        error: function (xhr) {
            alert("An error occured: " + xhr.status + " " + xhr.statusCode);
        },
        success: function (data) {
            if (data) {
                $('#Domain_ID').val(data.lanId);
                $("#Name").val(data.name);
                $("#Email").val(data.email);
            }
        }
    });
});

Wednesday, February 27, 2019

SQL RAISEERROR and Log the error

Put all SQL Stored Procedures in BEGIN TRY > BEGIN TRANSACTION > IF  ELSE blocks and use the following as a TEMPLATE

Create an output parameter so the source code can log the error and you can check the DB table for the error.


@ELog_ID int = 0 OUTPUT 

SET XACT_ABORT, NOCOUNT ON;

BEGIN TRY
BEGIN TRANSACTION


IF
            IF EXISTS (SELECT 'x' FROM People_tbl WHERE Email_Address = @Email_Address)
RAISERROR (N'Person is already in the database.',11,11, 'usr_Person_Add')
--PRINT 'Person is already in the database!'

ELSE

-- CRUD work

END TRY

BEGIN CATCH

--PRINT 'In the Catch Statement'
IF @@trancount > 0 ROLLBACK TRANSACTION
PRINT 'Process has reached the CATCH'

EXECUTE dbo.[usr_InsertErrorInfo];

SELECT @ELog_ID = max(ELog_ID)
FROM ErrorLog_tbl;


END CATCH


Monday, January 07, 2019

RoboCopy

Robocopy command can be used to move data from one folder to another.
example:
Go to cmd
Robocopy "C:\\SourceDir" "C:\\DestDir" \/E  // adding escapes to see if sitemap.xml cleans up addwd exra \

above command copies all folders, subfolders and files from source to destination folder.
Happy Learning!

Read more about this here:
https://social.technet.microsoft.com/wiki/contents/articles/1073.robocopy-and-a-few-examples.aspx

MIR option. It can intelligently mirror source and destination, copying ONLY changed files and deleting files on the destination that are no longer on the source. Very useful when you need to maintain a backup|standby system. rsync is the unix equivalent to this command. I used rsync at home just yesterday. Great stuff!

Azure Cost Learning from Experience after Free Trial Expires

Well, today I logged into my Bank account and I have I nice debit of "MSFT AZURE", although I thought I was very careful to turn off all the Apps/Slots I would not be charged.







https://azure.microsoft.com/en-us/pricing/details/app-service/windows/

Another lesson by experience, I was wrong if you have a Plan aka S1 you will be charged even if you do not have one service running.



Set-AzureRmAppServicePlan -ResourceGroupName $rg -Name $AppServicePlan -Tier Free

Wednesday, December 19, 2018

Microsoft Word Navigation Pane (Keep It Open - TOC)

To get to the Microsoft Word Navigation click ctrl+f then select navigation pane and leave it open while working on a very long document.   It will help you from pulling out your hair.

Friday, November 02, 2018

JavaScript Execution

1) Global Memory 2) Global Execution 3) Call Stack Tatoo it on my arm. Be a JavaScript Master mind --- JavaScript is Single Threaded. function myFunc(){ Console.write("Hello Moojjoo Blogger"); } That function will never run unless it is called. It is stored in the Global Memory, but will never execute unless you call myFunc(); Aka Functions, Executions, Contexts and Call Stack... Know that and JavaScript will be easy for you.

Monday, October 08, 2018

How to delete or clear authentication, cache, and cookies

Instead of trying to hunt down cookies to delete or clear cache for images, authentication, etc. etc. Simply use a Chrome Incognito or Edge new private window. Brand new fresh clean browser window.

Tuesday, October 02, 2018

.NET Core 500 Exception how to see your errors

If you are developing using .Net Core be sure to set the final Configure to the following and be sure to use your keyboard short cut alt+enter to bring in the missing using namespaces for your references needed. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { env.EnvironmentName = EnvironmentName.Development; if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/error"); } app.UseStatusCodePages(); // Enable middleware to serve generated Swagger as a JSON endpoint. app.UseSwagger(); // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), // specifying the Swagger JSON endpoint. app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); c.RoutePrefix = string.Empty; }); app.UseMvc(); } }

Tuesday, July 17, 2018

Windows 7 cannot delete folder

I ran into an issue from an import for Favorites and I could not delete the folder. The following YouTube Video helped me resolve the problem. https://www.youtube.com/watch?v=GPpsT37ija0

Wednesday, May 23, 2018

ID4014: A SecurityTokenHandler is not registered to read security token error

Getting the following error (Figure 1):

Server Error in '/' Application.

ID4014: A SecurityTokenHandler is not registered to read security token ('Assertion', 'urn:oasis:names:tc:SAML:2.0:assertion').

 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IdentityModel.Tokens.SecurityTokenException: ID4014: A SecurityTokenHandler is not registered to read security token ('Assertion', 'urn:oasis:names:tc:SAML:2.0:assertion').

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SecurityTokenException: ID4014: A SecurityTokenHandler is not registered to read security token ('Assertion', 'urn:oasis:names:tc:SAML:2.0:assertion').] Microsoft.IdentityModel.Web.TokenReceiver.ReadToken(String tokenXml, XmlDictionaryReaderQuotas readerQuotas) +370 Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.SignInWithResponseMessage(HttpRequest request) +330 Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs args) +323 Microsoft.SharePoint.IdentityModel.SPFederationAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs eventArgs) +138 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +209 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +91




Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2623.0 

Figure 1

Here are some facts:

Azure Active Directory ID (Figure 2):

Figure 2



Application “PNG Projects” Object ID (Figure 3)
Figure 3




Again, trying to convert from SAML 2.0 to SAML 1.1 because SharePoint 2013 and 2016 only accept SAML 1.1.



I have the reply populated in Azure AD as https://projects-dev02-extranet.domain.com/_trust/default.aspx


Friday, May 18, 2018

AADSTS70001: Application with identifier

Getting the following error (Figure 1):

Figure 1

Here are some facts:

Azure Active Directory ID (Figure 2):

Figure 2



Application “PNG Projects” Object ID (Figure 3)
Figure 3

SAML Sign-In Information (Figure 4):

Figure 4


PowerShell with SharePoint Snap-In Showing the Token installed (Figure 5)

Installed RAW Certificate PS C:\Windows\system32> Get-SPTrustedRootAuthority "AzureAD"
Get-SPTrustedIdentityTokenIssuer "AzureAD"


Certificate                 : [Subject]
                                CN=Microsoft Azure Federated SSO Certificate
                             
                              [Issuer]
                                CN=Microsoft Azure Federated SSO Certificate
                             
                              [Serial Number]
                                316201B4157F75B444B5876DD1EF36E0
                             
                              [Not Before]
                                5/16/2018 5:13:24 PM
                             
                              [Not After]
                                5/16/2021 5:13:24 PM
                             
                              [Thumbprint]
                                38B1DA740F7D2C8EAD5E95F6F16B9D8XXXXXXXXXXXX
                             
Name                        : AzureAD
TypeName                    : Microsoft.SharePoint.Administration.SPTrustedRootAuthority
DisplayName                 : AzureAD
Id                          : 1f6fa3f9-a67e-4827-bd49-ca5c14e74849
Status                      : Online
Parent                      : SPTrustedRootAuthorityManager
Version                     : 12719405
Properties                  : {}
Farm                        : SPFarm Name=SP_Config
UpgradedPersistedProperties : {}

ProviderSignOutUri            :
DefaultProviderRealm          : urn:sharepoint:projects-dev02.domain.com
ProviderRealms                : {}
ClaimTypes                    : {http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname}
HasClaimTypeInformation       : True
ClaimTypeInformation          : {name, GivenName, SurName}
ClaimProviderName             :
UseWReplyParameter            : False
UseWHomeRealmParameter        : False
GroupClaimType                :
RegisteredIssuerName          :
IdentityClaimTypeInformation  : Microsoft.SharePoint.Administration.Claims.SPTrustedClaimTypeInformation
Description                   : SharePoint secured by Azure AD
SigningCertificate            : [Subject]
                                  CN=Microsoft Azure Federated SSO Certificate
                               
                                [Issuer]
                                  CN=Microsoft Azure Federated SSO Certificate
                               
                                [Serial Number]
                                  316201B4157F75B444B5876DD1EF36E0
                               
                                [Not Before]
                                  5/16/2018 5:13:24 PM
                               
                                [Not After]
                                  5/16/2021 5:13:24 PM
                               
                                [Thumbprint]
                                  38B1DA740F7D2C8EAD5E95F6F16B9D8E7D5FB5EB
                                
AdditionalSigningCertificates : {}
MetadataEndPoint              :
IsAutomaticallyUpdated        : False
Name                          : AzureAD
TypeName                      : Microsoft.SharePoint.Administration.Claims.SPTrustedLoginProvider
DisplayName                   : AzureAD
Id                            : 742ae843-6936-4b30-bdae-1321d3907486
Status                        : Online
Parent                        : SPSecurityTokenServiceManager Name=SecurityTokenServiceManager
Version                       : 12719408
Properties                    : {}
Farm                          : SPFarm Name=SP_Config
UpgradedPersistedProperties   : {}

Figure 5

Again, trying to convert from SAML 2.0 to SAML 1.1 because SharePoint 2013 and 2016 only accept SAML 1.1.

Thus back to the issue with the first (Figure 1), This is the correct AppID how come I can getting a failure?



Friday, May 04, 2018

PowerShell 5.0

I have been having lots of trouble with using PowerShell with Azure.  In order to get it running I finally came across the following site for the correct downloads: https://docs.microsoft.com/en-us/powershell/wmf/5.0/requirements