<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Bulent's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/bulentozkir/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/bulentozkir/feed.xml</link>
    <description>Personal blog on Microsoft Technologies</description>
    <lastBuildDate>Mon, 22 Oct 2018 11:28:53 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>install OMS Log Analytics Agent and OMS Dependency Agent to all Windows VMs in the subscription using PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/bulentozkir/install-oms-log-analytics-agent-and-oms-dependency-agent-to-all-windows-vms-in-the-subscription-using-powershell</link>
      <pubDate>Mon, 03 Jul 2017 15:25:34 GMT</pubDate>
      <dc:creator><![CDATA[Bulent Ozkir]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bulentozkir/?p=2035</guid>
      <description><![CDATA[Save the following code as myscript.ps1 by replacing the ????? with the OMS workspaceid and OMS...]]></description>
      <content:encoded><![CDATA[<strong>Save the following code as myscript.ps1 by replacing the ????? with the OMS workspaceid and OMS workspace key. Share the file using Storage Account Shared Access key as https:// </strong>

<code>function installOMS {

param(
[parameter(Mandatory=$true, HelpMessage="OMS Log Analytics Workspace ID")]
[ValidateNotNullOrEmpty()]
[string]$WorkSpaceID,

[parameter(Mandatory=$true, HelpMessage="OMS Log Analytics Workspace Key")]
[ValidateNotNullOrEmpty()]
[string]$WorkSpaceKey
)

$verboseactionoutput = "continue"
# Set the parameters
$FileName = "MMASetup-AMD64.exe"
$SMFileName = "InstallDependencyAgent-Windows.exe"
$OMSFolder = 'C:\OMSinstallSource'
$MMAFile = $OMSFolder + "\" + $FileName
$SMFile = $OMSFolder + "\" + $SMFileName

# Check if folder exists, if not, create it
Write-Verbose "Create folder $OMSFolder..."
New-Item $OMSFolder -type Directory -Force | Out-Null
Write-Verbose "created!"

# Change the location to the specified folder
Set-Location $OMSFolder

try
{

# Download OMS Log Analytics monitoring agent
Write-Verbose "downloading monitoring agent..."
$URL = "https://go.microsoft.com/fwlink/?LinkId=828603"
Invoke-WebRequest -Uri $URl -OutFile $MMAFile | Out-Null
Write-Verbose "downloaded!"

# Download OMS Log Analytics dependency agent
Write-Verbose "downloading dependency agent..."
$URL = "https://aka.ms/dependencyagentwindows"
Invoke-WebRequest -Uri $URl -OutFile $SMFile | Out-Null
Write-Verbose "downloaded!"

# Install the Microsoft Monitoring Agent
Write-Verbose "Installing Microsoft Monitoring Agent.."
$ArgumentList = '/C:"setup.exe /qn ADD_OPINSIGHTS_WORKSPACE=1 '+ "OPINSIGHTS_WORKSPACE_ID=$WorkspaceID " + "OPINSIGHTS_WORKSPACE_KEY=$WorkSpaceKey " +'AcceptEndUserLicenseAgreement=1"'
Start-Process $FileName -ArgumentList $ArgumentList -ErrorAction Stop -Wait | Out-Null
Write-Verbose "installed!"

# Install the Service Map Agent
Write-Verbose "Installing dependency Agent.."
$ArgumentList = '/C:"InstallDependencyAgent-Windows.exe /S /AcceptEndUserLicenseAgreement:1"'
Start-Process $SMFileName -ArgumentList $ArgumentList -ErrorAction Stop -Wait | Out-Null
Write-Verbose "installed!"

# Change the location to C: to remove the created folder
Set-Location -Path "C:\"

# Remove the folder with the agent files
Write-Verbose "Removing the folder $OMSFolder ..."
Remove-Item $OMSFolder -Force -Recurse | Out-Null
Write-Verbose "removed!"
}
catch
{
Write-Error -Message $_.Exception
throw $_.Exception
}

}

installOMS -WorkSpaceID "<strong>?????????????</strong>" -WorkSpaceKey "<strong>???????????</strong>"

</code>

<strong>Run the following code on any management client to inject the agents installation using Custom Script Extension for the Windows VMs in the subscription. Change the ??????? withe URL of the shared ps1 file.</strong>

<code>$cred = Get-Credential 
Add-AzureRmAccount -Credential $cred 
Get-AzureRmSubscription 
Set-AzureRmContext -SubscriptionId "<strong>????????</strong>" 

$allvms = Get-AzureRmVM | where {$allvms[0].OSProfile.LinuxConfiguration -eq $null}

foreach ($vm in $allvms)
{ 
    # Remove the script extention 
    Remove-AzureRmVMCustomScriptExtension -ResourceGroupName $vm.ResourceGroupName `
    -VMName $vm.Name -Name "myCustomScript"

    # Deploy the script extenion
    Set-AzureRmVMCustomScriptExtension -ResourceGroupName $vm.ResourceGroupName `
    -VMName $vm.Name -Name "myCustomScript" `
    -FileUri "https://<strong>?????????</strong>/myscript.ps1.ps1" `
    -Run "myscript.ps1" -Location "West EU"
}  
</code>]]></content:encoded>
    </item>
    <item>
      <title>Post data to OMS Log Analytics Data Collector API using PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/bulentozkir/post-data-to-oms-log-analytics-data-collector-api-using-powershell</link>
      <pubDate>Tue, 20 Jun 2017 15:21:08 GMT</pubDate>
      <dc:creator><![CDATA[Bulent Ozkir]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bulentozkir/?p=2005</guid>
      <description><![CDATA[# Create the function to create and post the request
Function Post-OMSData($customerId,...]]></description>
      <content:encoded><![CDATA[<code>
# Create the function to create and post the request
Function Post-OMSData($customerId, $sharedKey, $body, $logType)
{
    $method = "POST"
    $contentType = "application/json"
    $resource = "/api/logs"
    $rfc1123date = [DateTime]::UtcNow.ToString("r")
    $contentLength = $body.Length
    $signature = Build-Signature `
        -customerId $customerId `
        -sharedKey $sharedKey `
        -date $rfc1123date `
        -contentLength $contentLength `
        -fileName $fileName `
        -method $method `
        -contentType $contentType `
        -resource $resource
    $uri = "https://" + $customerId + ".ods.opinsights.azure.com" + $resource + "?api-version=2016-04-01"

    $headers = @{
        "Authorization" = $signature;
        "Log-Type" = $logType;
        "x-ms-date" = $rfc1123date;
        "time-generated-field" = $TimeStampField;
    }

    $response = Invoke-WebRequest -Uri $uri -Method $method -ContentType $contentType -Headers $headers -Body $body -UseBasicParsing -Proxy http:\\yourOMSGW
    return $response.StatusCode
}
</code>]]></content:encoded>
    </item>
    <item>
      <title>The difference between [Switch] and[Bool] in Powershell function parameters</title>
      <link>https://docs.microsoft.com/archive/blogs/bulentozkir/the-difference-between-switch-andbool-in-powershell-function-parameters</link>
      <pubDate>Tue, 20 Jun 2017 07:27:25 GMT</pubDate>
      <dc:creator><![CDATA[Bulent Ozkir]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bulentozkir/?p=1985</guid>
      <description><![CDATA[#switch parameter
cls
function MyAwesomeFunction1
{
[CMDLetBinding()]
param
(
[string]...]]></description>
      <content:encoded><![CDATA[<code>#switch parameter
cls
function MyAwesomeFunction1
{
[CMDLetBinding()]
param
(
[string] $foo,
[string] $bar,
[switch] $someVariable
)

Write-Host "someVariable = $someVariable" + $someVariable.GetType()

if($someVariable) {
Write-Host $foo
}
else {
Write-Host $bar
}
}

#boolean parameter
function MyAwesomeFunction2
{
[CMDLetBinding()]
param
(
[string] $foo,
[string] $bar,
[bool] $someVariable
)

Write-Host "someVariable = $someVariable" + $someVariable.GetType()

if($someVariable) {
Write-Host $foo
}
else {
Write-Host $bar
}
}

MyAwesomeFunction1 -foo "foo" -bar "bar" -someVariable:$true
MyAwesomeFunction1 -foo "foo" -bar "bar" -someVariable:$false
MyAwesomeFunction1 -foo "foo" -bar "bar" -someVariable
MyAwesomeFunction1 -foo "foo" -bar "bar" 

MyAwesomeFunction2 -foo "foo" -bar "bar" -someVariable $true
MyAwesomeFunction2 -foo "foo" -bar "bar" -someVariable $false
MyAwesomeFunction2 -foo "foo" -bar "bar" -someVariable 
MyAwesomeFunction2 -foo "foo" -bar "bar"</code>]]></content:encoded>
    </item>
    <item>
      <title>How to deploy OMS Log Analytics Agent and Dependency Agent using DSC</title>
      <link>https://docs.microsoft.com/archive/blogs/bulentozkir/how-to-deploy-oms-log-analytics-agent-and-dependency-agent-using-dsc</link>
      <pubDate>Thu, 15 Jun 2017 10:10:44 GMT</pubDate>
      <dc:creator><![CDATA[Bulent Ozkir]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bulentozkir/?p=1975</guid>
      <description><![CDATA[# replace the ??????????? in the script

Configuration MMAgent
{
$OIPackageLocalPath =...]]></description>
      <content:encoded><![CDATA[<code>
# replace the ??????????? in the script

Configuration MMAgent
{
$OIPackageLocalPath = "$env:temp\MMASetup-AMD64.exe"
$SMapPackageLocalPath = "$env:temp\InstallDependencyAgent-Windows.exe"
$OPSINSIGHTS_WS_ID = "??????????????"
$OPSINSIGHTS_WS_KEY = "??????????????"

Import-DscResource -ModuleName xPSDesiredStateConfiguration

Node SQLnode {
}

Node OMSnode {
Service OIService
{
Name = "HealthService"
State = "Running"
DependsOn = "[xPackage]OMSAgent"
}

Service DependencyService
{
Name = "MicrosoftDependencyAgent"
State = "Running"
DependsOn = "[xPackage]SmapAgent"
}

xRemoteFile OIPackage {
Uri = "https://go.microsoft.com/fwlink/?LinkId=828603"
DestinationPath = $OIPackageLocalPath
}

xRemoteFile SmapPackage {
Uri = "https://aka.ms/dependencyagentwindows"
DestinationPath = $SMapPackageLocalPath
}

xPackage OMSAgent {
Ensure = "Present"
Path = $OIPackageLocalPath
Name = "Microsoft Monitoring Agent"
ProductId = ""
Arguments = '/C:"setup.exe /qn ADD_OPINSIGHTS_WORKSPACE=1 OPINSIGHTS_WORKSPACE_ID=' + $OPSINSIGHTS_WS_ID + ' OPINSIGHTS_WORKSPACE_KEY=' + $OPSINSIGHTS_WS_KEY + ' AcceptEndUserLicenseAgreement=1"'
DependsOn = "[xRemoteFile]OIPackage"
}
#6D765BA4-C090-4C41-99AD-9DAF927E53A5

xPackage SmapAgent {
Path = $SMapPackageLocalPath
Ensure = 'Present'
Name = 'Dependency Agent'
ProductId = ''
Arguments = '/S'
DependsOn = '[xPackage]OMSAgent', '[xRemoteFile]SmapPackage'
}

}
}
</code>]]></content:encoded>
    </item>
    <item>
      <title>How to deploy OMS Log Analytics Agent and Dependency Agent to thousands of computers using PowerShell Workflow in parallel</title>
      <link>https://docs.microsoft.com/archive/blogs/bulentozkir/how-to-deploy-oms-log-analytics-agent-and-dependency-agent-to-thousands-of-computers-using-powershell-workflow-in-parallel</link>
      <pubDate>Thu, 01 Jun 2017 23:29:42 GMT</pubDate>
      <dc:creator><![CDATA[Bulent Ozkir]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bulentozkir/?p=1965</guid>
      <description><![CDATA[workflow installOMS{
#fill in the computers.txt in temp folder as one computer per line with no...]]></description>
      <content:encoded><![CDATA[<code>workflow installOMS{
#fill in the computers.txt in temp folder as one computer per line with no delimeters
$computers = inlinescript
{
$BaselineFile = "$env:temp\computers.txt"
$lines = (Get-Content $BaselineFile)
$computers = foreach ($line in $lines) { $line.Trim()}
return $computers
}

parallel
{

inlinescript
{

try
{

$OPSINSIGHTS_WS_ID = "??????"

$OPSINSIGHTS_WS_KEY = "?????"

$arg1 = '/C:"setup.exe /qn ADD_OPINSIGHTS_WORKSPACE=1 '+ "OPINSIGHTS_WORKSPACE_ID=$OPSINSIGHTS_WS_ID " + "OPINSIGHTS_WORKSPACE_KEY=$OPSINSIGHTS_WS_KEY " +'AcceptEndUserLicenseAgreement=1"'

write-output $env:computername

$myoutfile1 = "$env:temp\MMASetup-AMD64.exe"
Invoke-WebRequest "https://go.microsoft.com/fwlink/?LinkId=828603" -OutFile $myoutfile1
Start-Process -FilePath $myoutfile1 -ArgumentList $arg1 -Wait

$arg2 = "/S"
$myoutfile2 = "$env:temp\InstallDependencyAgent-Windows.exe"
Invoke-WebRequest "https://aka.ms/dependencyagentwindows" -OutFile $myoutfile2
Start-Process -FilePath $myoutfile2 -ArgumentList $arg2 -Wait
}
catch
{
Write-Error -Message $_.Exception
throw $_.Exception
}

} -PSComputerName $computers

}
}
</code>]]></content:encoded>
    </item>
    <item>
      <title>Create new user via Microsoft Graph using PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/bulentozkir/create-new-user-via-microsoft-graph-using-powershell</link>
      <pubDate>Sun, 09 Apr 2017 23:12:25 GMT</pubDate>
      <dc:creator><![CDATA[Bulent Ozkir]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bulentozkir/?p=1956</guid>
      <description><![CDATA[cls 

# Load Active Directory Authentication Library (ADAL) Assemblies
$adal =...]]></description>
      <content:encoded><![CDATA[cls 

# 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 = ”??????.onmicrosoft.com”
$login = Add-AzureRmAccount -Credential $cred
Get-AzureRmSubscription
Select-AzureRmSubscription -SubscriptionID ‘??????‘

# Set well-known client ID for Azure PowerShell
$clientId = "1950a258-227b-4e31-a9cf-717495945fc2” 
# Set redirect URI for Azure PowerShell
$redirectUri = "urn:ietf:wg:oauth:2.0:oob”
# Set Resource URI to Azure Service Management API
$resourceAppIdURI = "https://graph.microsoft.com”
# Set Authority to Azure AD Tenant
$authority = "https://login.windows.net/$adTenant"
# Create AuthenticationContext tied to Azure AD Tenant
$authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext” -ArgumentList $authority
# Acquire token
$authResult = $authContext.AcquireToken($resourceAppIdURI, $clientId, $mycred)
# Building Rest Api header with authorization token
$authHeader = @{
‘Content-Type’=‘application\json’
‘Authorization’=$authResult.CreateAuthorizationHeader()
}

#get users having their displayname starting with letter a 
$resource = "users”
$uri = "https://graph.microsoft.com/v1.0/users”
$users = (Invoke-RestMethod -Uri $uri –Headers $authHeader –Method Get –Verbose).value
$users

#create a new user
$newuser = @{
"accountEnabled”=$true;
"userPrincipalName”="name.surname2@?????.onmicrosoft.com”;
"displayName”="Name Surname”;
"passwordProfile”=@{
"password”="Mypassword1!”;`
"forceChangePasswordNextSignIn”=$true
};
"mailNickname”="name.surname2”
}
$newuserJsonDef = $newuser | ConvertTo-Json
$resource = "users”
$uri = "https://graph.microsoft.com/v1.0/users"
$result = Invoke-RestMethod -Uri $uri -Headers $authHeader -Method Post -Body $newuserJsonDef -ContentType "application/json”

#get users having their displayname starting with letter a 
$resource = "users”
$uri = "https://graph.microsoft.com/v1.0/users”
$users = (Invoke-RestMethod -Uri $uri –Headers $authHeader –Method Get –Verbose).value
$users]]></content:encoded>
    </item>
    <item>
      <title>user management using the AzureAD powershell module</title>
      <link>https://docs.microsoft.com/archive/blogs/bulentozkir/user-management-using-the-azuread-powershell-module</link>
      <pubDate>Sun, 09 Apr 2017 22:25:50 GMT</pubDate>
      <dc:creator><![CDATA[Bulent Ozkir]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bulentozkir/?p=1946</guid>
      <description><![CDATA[cls

$cred = Get-Credential

#Connect to your AzureAD tenant

Connect-AzureAD -Credential...]]></description>
      <content:encoded><![CDATA[cls

$cred = Get-Credential

#Connect to your AzureAD tenant

Connect-AzureAD -Credential $cred



# Get a user by UPN

$user = Get-AzureADUser -ObjectId "user1@????.onmicrosoft.com" 

$user | fl

# Update some properties 
$user = Set-AzureADUser -ObjectId $user.UserPrincipalName -Department "Azure Architecture" -Country "Turkey"

# Get a user by UPN
$user = Get-AzureADUser -ObjectId "user1@????.onmicrosoft.com" 

$user | fl
]]></content:encoded>
    </item>
    <item>
      <title>Managing Azure AD using Graph API and ADAL inside PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/bulentozkir/managing-azure-ad-using-graph-api-inside-powershell</link>
      <pubDate>Thu, 10 Nov 2016 08:47:04 GMT</pubDate>
      <dc:creator><![CDATA[Bulent Ozkir]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bulentozkir/?p=1885</guid>
      <description><![CDATA[# replace ??????? before running the script

cls
# visit...]]></description>
      <content:encoded><![CDATA[# replace ??????? before running the script

<code>cls
# visit "https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/38/metablogapi/image_74154BB9.png"
# 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 = ”bulentozkirhotmail.onmicrosoft.com”
$login = Add-AzureRmAccount -Credential $cred
Get-AzureRmSubscription
Select-AzureRmSubscription -SubscriptionID ‘????????????????‘
# Set well-known client ID for Azure PowerShell
$clientId = "1950a258-227b-4e31-a9cf-717495945fc2”
# Set redirect URI for Azure PowerShell
$redirectUri = "urn:ietf:wg:oauth:2.0:oob”
# Set Resource URI to Azure Service Management API
$resourceAppIdURI = "https://graph.windows.net/”
# Set Authority to Azure AD Tenant
$authority = "https://login.windows.net/$adTenant"
# Create AuthenticationContext tied to Azure AD Tenant
$authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext” -ArgumentList $authority
# Acquire token
$authResult = $authContext.AcquireToken($resourceAppIdURI, $clientId, $mycred)
# Building Rest Api header with authorization token
$authHeader = @{
‘Content-Type’=‘application\json’
‘Authorization’=$authResult.CreateAuthorizationHeader()
}
#get your Azure AD tenant details
$resource = "tenantDetails”
$uri = "https://graph.windows.net/$adTenant/$($resource)?api-version=1.6"
$tenantInfo = (Invoke-RestMethod -Uri $uri –Headers $authHeader –Method Get –Verbose).value
$tenantInfo
#get users having their displayname starting with letter a
$resource = "users”
$uri = "https://graph.windows.net/$adtenant/$($resource)?api-version=1.6`&amp;`$filter=startswith(displayName,'b')”
$users = (Invoke-RestMethod -Uri $uri –Headers $authHeader –Method Get –Verbose).value
$users
#get groups and get group members of each group
$resource = "groups”
$uri = "https://graph.windows.net/$adtenant/$($resource)?api-version=1.6"
$groups = (Invoke-RestMethod -Uri $uri –Headers $authHeader –Method Get –Verbose).value
foreach($group in $groups)
{
$objectid = $group.objectid
$uri = "https://graph.windows.net/$adtenant/groups/$objectid/members?api-version=1.6"
$members = (Invoke-RestMethod -Uri $uri –Headers $authHeader –Method Get –Verbose).value
$members
}
#create a new user
$newuser = @{
"accountEnabled”=$true;
"userPrincipalName”="john.doe@?????????????.onmicrosoft.com”;
"displayName”="John Doe”;
"passwordProfile”=@{
"password”="Mypassword1!”;`
"forceChangePasswordNextLogin”=$true
};
"mailNickname”="John.Doe”
}
$newuserJsonDef = $newuser | ConvertTo-Json
$resource = "users”
$uri = "https://graph.windows.net/$adtenant/$($resource)?api-version=1.6"
$result = Invoke-RestMethod -Uri $uri -Headers $authHeader -Method Post -Body $newuserJsonDef -ContentType "application/json”
#verify that user is created successfully
$uri = "https://graph.windows.net/$adtenant/users`?api-version=1.6`&amp;`$filter=mailNickname eq 'John.Doe'”
(Invoke-RestMethod -Uri $uri –Headers $authHeader –Method Get –Verbose).value</code>]]></content:encoded>
    </item>
    <item>
      <title>All about Office 365 Pro Plus deployment and updates</title>
      <link>https://docs.microsoft.com/archive/blogs/bulentozkir/all-about-office-365-pro-plus-deployment-and-updates</link>
      <pubDate>Mon, 19 Sep 2016 12:43:56 GMT</pubDate>
      <dc:creator><![CDATA[Bulent Ozkir]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bulentozkir/?p=1915</guid>
      <description><![CDATA[I have consolidated the most essential information about Office 365 Pro Plus deployment and updates...]]></description>
      <content:encoded><![CDATA[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. 

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/Office-365-ProPlus-deployment-and-updates.pptx">Office 365 ProPlus deployment and updates</a>]]></content:encoded>
    </item>
    <item>
      <title>Azure Resource Manager RBAC management practical tips</title>
      <link>https://docs.microsoft.com/archive/blogs/bulentozkir/azure-resource-manager-rbac-management-practical-tips</link>
      <pubDate>Fri, 09 Sep 2016 06:44:22 GMT</pubDate>
      <dc:creator><![CDATA[Bulent Ozkir]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bulentozkir/?p=1875</guid>
      <description><![CDATA[Please make sure that you have installed the latest Azure and Azure AD PowerShell libraries as I...]]></description>
      <content:encoded><![CDATA[Please make sure that you have installed the latest Azure and Azure AD PowerShell libraries as I posted in my previous blogs. <a href="https://aka.ms/op0ndc">https://aka.ms/op0ndc</a>

First let's login to Azure AD.
<blockquote>$cred = Get-Credential

Add-AzureRmAccount -Credential $mycred

Select-AzureRmSubscription -SubscriptionID '???'</blockquote>
This script lists all the role definitions.
<blockquote>Get-AzureRmRoleDefinition| Select-Object Name</blockquote>
This script lists all possible actions for a particular role.
<blockquote>(Get-AzureRmRoleDefinition -Name 'Virtual Machine Contributor').Actions</blockquote>
This script lists all possible operations for a resource provider.
<blockquote>Get-AzureRmProviderOperation 'Microsoft.Compute/*' | Select-Object Operation,OperationName | fl</blockquote>
This script lists all possible action operations for a resource provider.
<blockquote>Get-AzureRmProviderOperation 'Microsoft.Compute/*/action' | Select-Object Operation,OperationName | fl</blockquote>
In order to create a custom role definition in a subscription you own, you can clone an existing role defition and modify it by adding or removing resource provider operations. You can run the following script.
<blockquote>$subscriptionID = '???'
$role = Get-AzureRmRoleDefinition -Name 'Virtual Machine Contributor'
$role.Id= $null
$role.Name= 'My Custom VM Operator'
$role.Description= 'This custom role can monitor, start, and restart virtual machines.'
$role.Actions.RemoveRange(0,$role.Actions.Count)
$role.Actions.Add('Microsoft.Compute/*/read')
$role.Actions.Add('Microsoft.Compute/virtualMachines/start/action')
$role.Actions.Add('Microsoft.Compute/virtualMachines/restart/action')
$role.Actions.Add('Microsoft.Compute/virtualMachines/redeploy/action')
$role.Actions.Add('Microsoft.Compute/virtualMachines/poweroff/action')
$role.Actions.Add('Microsoft.Compute/virtualMachines/deallocate/action')
$role.Actions.Add('Microsoft.Network/*/read')
$role.Actions.Add('Microsoft.Storage/*/read')
$role.Actions.Add('Microsoft.Authorization/*/read')
$role.Actions.Add('Microsoft.Resources/subscriptions/resourceGroups/read')
$role.Actions.Add('Microsoft.Resources/subscriptions/resourceGroups/resources/read')
$role.Actions.Add('Microsoft.Insights/alertRules/*')
$role.Actions.Add('Microsoft.Support/*')
$role.AssignableScopes.Remove('/') | Out-Null
$role.AssignableScopes.Add('/subscriptions/' + $subscriptionID)
New-AzureRmRoleDefinition -Role $role</blockquote>
In order to remove the custom role you created, you can run the following script.
<blockquote>Get-AzureRmRoleDefinition 'My Custom VM Operator' | Remove-AzureRmRoleDefinition</blockquote>
In order to modify an existing custom role, you can run the following script.
<blockquote>$role = Get-AzureRmRoleDefinition 'My Custom VM Operator'
$role.Actions.Add("Microsoft.Insights/diagnosticSettings/*")
Set-AzureRmRoleDefinition -Role $role</blockquote>
In order to assign the custom role to different scopes, you can run the following script.
<blockquote>$role = Get-AzureRmRoleDefinition 'My Custom VM Operator'
$role.AssignableScopes.Add("/subscriptions/???")
Set-AzureRmRoleDefinition -Role $role</blockquote>
In order to clear all assignable scopes for a custom role, please run the following script.
<blockquote>$role = Get-AzureRmRoleDefinition 'My Custom VM Operator'
$role.AssignableScopes.Clear()
Set-AzureRmRoleDefinition -Role $role</blockquote>
In order to list all custom roles that are created, you can run the following script.
<blockquote>Get-AzureRmRoleDefinition | Where {$_.IsCustom -eq $true} | FT Name, IsCustom</blockquote>
If you get an error stating that "<strong>Registering the Resource Providers failed. The client does not have authorization to perform action over scope. Authorizationfailed.</strong>" for a delegated power user, even though you assign the person Owner role at Resource Group level in your Azure ARM RBAC mode, that means you need to register all resource providers. You can overcome this minor issue, by running the following script.
<blockquote>Add-AzureRmAccount

$subscriptions = Get-AzureRmSubscription

foreach ($sub in $subscriptions)
{

select-AzureRmSubscription -SubscriptionId $sub.SubscriptionId

Get-AzureRmResourceProvider -ListAvailable | Register-AzureRmResourceProvider -Force

}</blockquote>]]></content:encoded>
    </item>
  </channel>
</rss>