Skip to content

Instantly share code, notes, and snippets.

View JayVDZ's full-sized avatar

Jay Van der Zant JayVDZ

View GitHub Profile
@nzpcmad
nzpcmad / Contact.cshtml
Created April 21, 2016 01:54
Displaying claims in an ASP.NET MVC application
@*Replace existing code with ...*@
@{
ViewBag.Title = "User Claims";
}
<h2>Welcome: @ViewBag.ClaimsIdentity.Name</h2>
<h3>Values from Identity</h3>
<table>
<tr>
@nzpcmad
nzpcmad / Contact.cshmtl
Last active December 7, 2017 14:41
Displaying claims in an .NET Core MVC application to Azure AD
@{
ViewBag.Title = "User Claims";
}
<h2>Welcome: @ViewBag.Name</h2>
<h3>Values from Identity</h3>
<table>
<tr>
<th>
IsAuthenticated -
@mombrea
mombrea / DbInitializer.cs
Last active April 5, 2023 21:55
EF Core 1.0 and ASP.NET Core Identity Seed Data
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using System.Linq;
namespace My.App.Data
{
public class DbInitializer : IDbInitializer
{
private readonly ApplicationDbContext _context;
private readonly UserManager<ApplicationUser> _userManager;
@mrik23
mrik23 / MSOL-BulkRemoveDirectAssignedLicense.ps1
Last active June 7, 2023 04:23
Remove in bulk direct assigned license to users who have group assigned license with Azure AD PowerShell v1
<#
Modified version of the script from Microsoft Documentation.
Removed the part that checks if the users is assigned more products than the group assigned license.
Added connection part and help to find Sku and Group Object ID.
This script requires Azure AD (aks MSOL) PowerShell v1. It doesn't seem possible to do so with v2.
Ref: https://docs.microsoft.com/en-us/azure/active-directory/active-directory-licensing-ps-examples
#>
Import-Module MSOnline
$UserCredential = Get-Credential