Managing Azure AD using Graph API and ADAL inside PowerShell

# replace ??????? before running the script cls # visit “” # Load Active Directory Authentication Library (ADAL) Assemblies $adal = “${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\Microsoft.IdentityModel.Clients.ActiveDirectory.dll” $adalforms = “${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll” [System.Reflection.Assembly]::LoadFrom($adal) [System.Reflection.Assembly]::LoadFrom($adalforms) $cred = Get-Credential $mycred = new-object Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential($cred.UserName,$cred.Password) # Defining Azure AD tenant name, this is the name of your Azure Active Directory $adTenant = ”” $login…


All about Office 365 Pro Plus deployment and updates

I have consolidated the most essential information about Office 365 Pro Plus deployment and updates in a single concise presentation. Please use it if you find it helpful. If there are any mistakes in this presentation, please let me know so that I can correct and republish it immediately. Office 365 ProPlus deployment and updates


Azure Resource Manager RBAC management practical tips

Please make sure that you have installed the latest Azure and Azure AD PowerShell libraries as I posted in my previous blogs. First let’s login to Azure AD. $cred = Get-Credential Add-AzureRmAccount -Credential $mycred Select-AzureRmSubscription -SubscriptionID ‘???’ This script lists all the role definitions. Get-AzureRmRoleDefinition| Select-Object Name This script lists all possible actions for…


Deploying your MFA Server On Premises that is integrated with ADFS server (Windows Server 2012 R2)

You can install MFA Server on ADFS server on premises. The installation steps are documented in these KB articles and , respectively.   To install the Azure Multi-Factor Authentication Server locally on the same server as AD FS Download and install the Azure Multi-Factor Authentication Server on your AD FS federation server. In…


Export all NGS rules in ARM for all Subscriptions

You can associate different NSGs to a VM (or NIC, depending on the deployment model) and the subnet that a NIC or VM is bound to. When that happens, all network access rules are applied to the traffic, by priority in each NSG, in the following order:   Inbound traffic NSG applied to subnet. If subnet…


how to resize your VNET Gateway from Basic to High Performance

Please note that when you create a VNET Gateway, the default Virtual Network Gateway SKU is Basic. If you need higher level SKU for better gateway performance with some extra cost (check Azure pricing page for more detais), you can modify the VNET Gateway size to Standard or HighPerformace as below. You can change it…


how to export VM details in Azure Resource Manager (ARM)

1. Run the following PowerShell script. $cred = Get-Credential (Login-AzureRmAccount -Credential $cred)>0 $Subscriptions = Get-AzureRMSubscription $vmarray = @() $i=0 foreach ( $Subscription in $Subscriptions ) { $SubscriptionId = $Subscription.SubscriptionId (Login-AzureRmAccount -Credential $cred -subscriptionid $SubscriptionId)>0 (Select-AzureRMSubscription -SubscriptionId $SubscriptionId)>0 $i++ Write-Progress -activity $subscription.SubscriptionName -PercentComplete ($i/$Subscriptions.Count*100) ($rmvms=Get-AzurermVM) > 0 foreach ($vm in $rmvms) { $vmstatus = Get-AzurermVM -Name…


how to resize your OS disk of your Azure VM to maximum allowed size

1. Run the following PowerShell. Modify the parameters accordingly. $cred = Get-Credential Login-AzureRmAccount -Credential $cred $resourceGroup = “nerg1” $location = “North Europe” $vmName = “nerg1win1” $vm = Get-AzureRmVM -ResourceGroupName $resourceGroup -Name $vmName Stop-AzureRmVM -ResourceGroupName $resourceGroup -Name $vmName -Force $vm.StorageProfile.OsDisk.DiskSizeGB = 1023 Update-AzureRmVM -ResourceGroupName $resourceGroup -VM $vm   Start-AzureRmVM -ResourceGroupName $resourceGroup -Name $vmName 2. Extend the…


AADConnect error: The management agent “” failed on run profile “Delta Import” because the database or database log file is full.

On the AADConnect server’s Windows event log, if you get an error similar to “The management agent failed on run profile Delta Import because the database or database log file is full”, probably you need to cleanup AADConnect run profiles history and take backup of SQL Express database. First of all, please verify that you…


How can you move your running (not generalized) Linux VHD to Azure ARM in just a few steps?

1) Prepare your standard Azure management client environment as explained in my previous blog. Keep all the modules up to date. 2) Create a new Resource Group in Azure 3) Inside the Resource Group create a new Storage Account of your choice, prefer Locally Redundant Storage for simple requirements and its pricing advantages. 4) Create a new container…