<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>powershell &#8211; Sibeesh Passion</title>
	<atom:link href="https://www.sibeeshpassion.com/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Fri, 20 May 2022 18:33:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>powershell &#8211; Sibeesh Passion</title>
	<link>https://www.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Get Azure Blob Storage Blob Metadata Using PowerShell</title>
		<link>https://www.sibeeshpassion.com/get-azure-blob-storage-blob-metadata-using-powershell/</link>
					<comments>https://www.sibeeshpassion.com/get-azure-blob-storage-blob-metadata-using-powershell/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 20 May 2022 16:15:54 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Azure Storage]]></category>
		<category><![CDATA[Get blob metadata using PowerShell]]></category>
		<category><![CDATA[powershell]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14572</guid>

					<description><![CDATA[Here we will see how you can get the metadata of each blob available in your Azure storage account using PowerShell.]]></description>
										<content:encoded><![CDATA[
<p>This is going to be a quick blog post. Here we will see how you can get the metadata of each blob available in your Azure storage account using PowerShell. Here I assume that you have access to your storage account and you will be asked to log in. Let&#8217;s get started. </p>



<h2 class="wp-block-heading">PowerShell command to get the metadata</h2>



<p><a href="https://gist.github.com/SibeeshVenu/a735db3439ca50305a5141ab83d26892" target="_blank" rel="noreferrer noopener">Here</a> is the command to get the metadata of all of your blobs in your storage account. </p>



<script src="https://gist.github.com/SibeeshVenu/a735db3439ca50305a5141ab83d26892.js"></script>



<p>Set your execution policy to Process if you get any policy errors. </p>



<pre class="wp-block-code"><code>Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope Process</code></pre>



<p>If you get an authorization error as follows, make sure to add a role assignment of <strong>Storage Blob Data Contributor</strong>. You can do this via Access Control (IAM) of your storage account. Read more about this role <a href="https://docs.microsoft.com/en-us/azure/storage/blobs/assign-azure-role-data-access?tabs=portal" target="_blank" rel="noreferrer noopener">here</a>.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>PowerShell AuthorizationPermissionMismatch Error</p><cite>Get-AzStorageContainer : This request is not authorized to perform this operation using this permission.<br>RequestId:405a7e1a-f01e-004f-3acd-6a1168000000<br>Time:2022-05-18T15:38:30.5034936Z<br>Status: 403 (This request is not authorized to perform this operation using this permission.)<br>ErrorCode: AuthorizationPermissionMismatch<br>Content:<br>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;&lt;Error&gt;&lt;Code&gt;AuthorizationPermissionMismatch&lt;/Code&gt;&lt;Message&gt;This request is not authorized to perform this operation using<br>this permission.</cite></blockquote>



<p>Once you add the role, you can try running your PowerShell command after a few minutes. Please make sure to provide the values to the variables <strong>$containerName, $subscriptionid, $storageAccName</strong>. Happy coding with PowerShell!</p>



<h2 class="wp-block-heading">About the Author</h2>



<p>I am yet another developer who is passionate about writing and video creation. I have written close to 500 blogs on my&nbsp;<a rel="noreferrer noopener" href="https://sibeeshpassion.com/" target="_blank">blog</a>. If you like this content, consider following me here,</p>



<ul class="wp-block-list"><li><a href="https://github.com/SibeeshVenu">GitHub</a></li><li><a href="https://medium.com/@sibeeshvenu">medium</a></li><li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li></ul>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>Thanks a lot for reading. Did I miss anything that you may think is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p>Kindest Regards</p>



<p>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/get-azure-blob-storage-blob-metadata-using-powershell/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Change MFA Phone/Mobile Number Using PowerShell</title>
		<link>https://www.sibeeshpassion.com/change-mfa-phone-mobile-number-using-powershell/</link>
					<comments>https://www.sibeeshpassion.com/change-mfa-phone-mobile-number-using-powershell/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 19 Oct 2021 14:39:18 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure AD]]></category>
		<category><![CDATA[change mfa mobile number using powershell]]></category>
		<category><![CDATA[powershell]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14494</guid>

					<description><![CDATA[Did you know that you can change the mobile number of a user from Azure AD, by using PowerShell? Here in this post, we will see how easy it is to change the user properties of an AD user.]]></description>
										<content:encoded><![CDATA[
<p>Did you know that you can change the mobile number of a user from Azure AD, by using PowerShell? Here in this post, we will see how easy it is to change the user properties of an AD user. To get started, we need to install the AzureAD module from the <a rel="noreferrer noopener" href="https://www.powershellgallery.com/packages/AzureAD/2.0.2.140" target="_blank">PowerShell Gallery</a> You can get more details about this module <a rel="noreferrer noopener" href="https://docs.microsoft.com/en-us/powershell/module/azuread/?view=azureadps-2.0&amp;WT.mc_id=AZ-MVP-5001828" target="_blank">here</a>. </p>



<pre class="wp-block-code"><code>Install-Module -Name AzureAD</code></pre>



<p>You will be prompted to accept the installation, give Yes or A. </p>



<pre class="wp-block-code"><code>Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'?
&#91;Y] Yes  &#91;A] Yes to All  &#91;N] No  &#91;L] No to All  &#91;S] Suspend  &#91;?] Help (default is "N"): A</code></pre>



<p>You can also check whether this module is installed or not by using the command <code>Get-Module AzureADPreview</code></p>



<p>Once you are done, it is time to connect to your Azure AD by using the command <code>Connect-AzureAD</code>. That will give you an output as in the preceding image. </p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2021/10/image.png"><img fetchpriority="high" decoding="async" width="1024" height="111" src="/wp-content/uploads/2021/10/image-1024x111.png" alt="" class="wp-image-14495" srcset="/wp-content/uploads/2021/10/image-1024x111.png 1024w, /wp-content/uploads/2021/10/image-300x33.png 300w, /wp-content/uploads/2021/10/image-768x83.png 768w, /wp-content/uploads/2021/10/image-1536x166.png 1536w, /wp-content/uploads/2021/10/image.png 1707w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Connect-AzureAD Output</figcaption></figure>



<p>Now, use the command below to change the properties of your user. </p>



<pre class="wp-block-code"><code>Set-AzureADUser -ObjectId user1@domain.com -OtherMails @("user2@domain.com") -Mobile "+353 000000000" -TelephoneNumber "+353 000000000"</code></pre>



<p>You can also verify the changes by running the commands below. </p>



<pre class="wp-block-code"><code>Get-AzureADUser -ObjectID user@domain.com | select otherMails
Get-AzureADUser -ObjectID user@domain.com | select Mobile
Get-AzureADUser -ObjectID user@domain.com | select TelephoneNumber</code></pre>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2021/10/image-1.png"><img decoding="async" width="1024" height="470" src="/wp-content/uploads/2021/10/image-1-1024x470.png" alt="" class="wp-image-14496" srcset="/wp-content/uploads/2021/10/image-1-1024x470.png 1024w, /wp-content/uploads/2021/10/image-1-300x138.png 300w, /wp-content/uploads/2021/10/image-1-768x353.png 768w, /wp-content/uploads/2021/10/image-1-1536x705.png 1536w, /wp-content/uploads/2021/10/image-1.png 1708w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Get-AzureADUser Output</figcaption></figure>



<p>After you have changed your mobile number, verify the same when it is asked, and you should be able to Enable the Two-Step Verification on the <a href="https://mysignins.microsoft.com/security-info" target="_blank" rel="noreferrer noopener">Security Information page</a>. </p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2021/10/image-2.png"><img decoding="async" width="1024" height="231" src="/wp-content/uploads/2021/10/image-2-1024x231.png" alt="" class="wp-image-14497" srcset="/wp-content/uploads/2021/10/image-2-1024x231.png 1024w, /wp-content/uploads/2021/10/image-2-300x68.png 300w, /wp-content/uploads/2021/10/image-2-768x173.png 768w, /wp-content/uploads/2021/10/image-2-1536x347.png 1536w, /wp-content/uploads/2021/10/image-2-2048x462.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Enable two-step verification</figcaption></figure>



<p></p>



<h1 class="wp-block-heading">References</h1>



<p><a href="https://docs.microsoft.com/en-us/azure/active-directory/authentication/howto-sspr-authenticationdata#use-powershell-version-2">https://docs.microsoft.com/en-us/azure/active-directory/authentication/howto-sspr-authenticationdata#use-powershell-version-2</a></p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/change-mfa-phone-mobile-number-using-powershell/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating an Azure VM from the VHDX/VHD File</title>
		<link>https://www.sibeeshpassion.com/creating-an-azure-vm-from-the-vhdx-vhd-file/</link>
					<comments>https://www.sibeeshpassion.com/creating-an-azure-vm-from-the-vhdx-vhd-file/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 06 Mar 2019 09:50:03 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure Managed Image]]></category>
		<category><![CDATA[Azure Virtual Machine]]></category>
		<category><![CDATA[Azure VM]]></category>
		<category><![CDATA[Convert VHDX to VHD]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[VHDX and VHD]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=13619</guid>

					<description><![CDATA[[toc] Introduction When you have an on premises Virtual Machine and if you need to move the same to a cloud, you should create a Virtual Hard Disk. The virtual hard disks are of two types, one is VHD and the other is VHDX. Unfortunately the Microsoft Azure cloud supports only the generation 1 VMs which are VHD, These VHDs are fixed size and the maximum size allowed is 1023 GB. Here in this article, we are going to see how we can spin up a Virtual Machine in Azure from the VHD file we have. I will explain why [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>[toc]</p>



<h2 class="wp-block-heading">Introduction</h2>



<p>When you have an on premises Virtual Machine and if you need to move the same to a cloud, you should create a Virtual Hard Disk. The virtual hard disks are of two types, one is VHD and the other is VHDX. Unfortunately the Microsoft Azure cloud supports only the generation 1 VMs which are VHD, These VHDs are fixed size and the maximum size allowed is 1023 GB. Here in this article, we are going to see how we can spin up a Virtual Machine in Azure from the VHD file we have. I will explain why I came to this situation in the Background section. I hope you will find this article useful. </p>



<h2 class="wp-block-heading">Background</h2>



<p>I was working with a product called UCS (Univention Corporate Server), you can consider it as a private play store where you can install and use your custom applications, you are also allowed to use the existing ones as well. Now I wanted to create an Azure VM with the UCS in it, but all I had in my hand was a VHDX file, which is not supported in Azure. </p>



<h2 class="wp-block-heading">Steps</h2>



<p>In this article, we will be doing the following tasks.</p>



<ol class="wp-block-list"><li>Converting the VHDX file to VHD</li><li>Upload it to the Azure Blob storage</li><li>Create a Managed Image from the VHD</li><li>Create the Virtual Machine from the Managed Image</li></ol>



<h2 class="wp-block-heading">Spin up the Azure VM from VHDX</h2>



<p>As we have discussed, the first step is to convert the VHDX file to VHD. </p>



<h3 class="wp-block-heading">Convert VHDX to VHD</h3>



<p>We are going to use PowerShell for the conversion as it has some modules already to support this conversion.</p>



<pre class="wp-block-code"><code>Convert-VHD –Path c:\CreateVM\ucs.vhdx –DestinationPath c:\CreateVM\ucs.vhd -VHDType Fixed</code></pre>



<p>Please be noted that the Argument <strong>-VHDType</strong> is very important, <g class="gr_ gr_3 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="3" data-gr-id="3">otherwise</g> you may be getting an error as <g class="gr_ gr_5 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" id="5" data-gr-id="5">follows,</g> when you try to create the Managed image using the command <strong>New-AzImage</strong>.</p>



<pre class="wp-block-code"><code>New-AzImage : Only blobs formatted as VHDs can be imported.
ErrorCode: InvalidParameter
ErrorMessage: Only blobs formatted as VHDs can be imported.
ErrorTarget: disks
StatusCode: 400
ReasonPhrase: Bad Request
OperationID : 16baa116-be93-4054-8ba9-265eda636f0c
At line:1 char:10
+ $image = New-AzImage -ImageName $imageName -ResourceGroupName $rgName ...
+          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzImage], ComputeCloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Automation.NewAzureRmImage</code></pre>



<p>Once you are done a new VHD image will be created in the destination path you have given. Please be noted that the size of this file may be huge, and when you upload it to the Blob storage, it may take a longer depends on the network speed you have.</p>



<h3 class="wp-block-heading">Upload the VHD file to Azure Blob Storage</h3>



<p>As a prerequisite, you should create a storage account before you start this process. Once you have created the storage account, you are good to go and start the upload. Go to your Storage account, and click on the Blobs under blob services. </p>



<ul class="wp-block-gallery columns-1 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex"><li class="blocks-gallery-item"><figure><img decoding="async" width="247" height="386" src="https://sibeeshpassion.com/wp-content/uploads/2019/02/Blobs.png" alt="" data-id="13620" data-link="https://sibeeshpassion.com/?attachment_id=13620" class="wp-image-13620" srcset="/wp-content/uploads/2019/02/Blobs.png 247w, /wp-content/uploads/2019/02/Blobs-192x300.png 192w" sizes="(max-width: 247px) 100vw, 247px" /></figure></li></ul>



<p> Now you can click on the +Container menu item and create a new container which is nothing but the container for your files. Now we can go inside the container and click on the Upload button. In the upcoming pop up you can select the VHD file using the file picker option and upload the file. As I said earlier, this process is totally depends on your network speed.</p>



<p>Sometimes, due to the browser inactivity, the uploading of the heavy files to the blobs using Azure portal can be a headache as it throws error. One of the suggestion I can give you here is to use Azure Storage Explorer tool, which is quite easy to use and effective. Once you download the tool, login with your Azure credentials and got to the storage accounts and click on Blob Containers. In the new window click on Upload and then Upload files. </p>



<p>Please make sure that you are selecting the Blob type as Page Blob and then click upload. The uploading is really faster if you are using the tool instead of the portal.</p>



<ul class="wp-block-gallery columns-1 is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex"><li class="blocks-gallery-item"><figure><img decoding="async" width="650" height="350" src="https://sibeeshpassion.com/wp-content/uploads/2019/02/Azure-Storage-Explorer.png" alt="" data-id="13623" data-link="https://sibeeshpassion.com/?attachment_id=13623" class="wp-image-13623" srcset="/wp-content/uploads/2019/02/Azure-Storage-Explorer.png 650w, /wp-content/uploads/2019/02/Azure-Storage-Explorer-300x162.png 300w, /wp-content/uploads/2019/02/Azure-Storage-Explorer-400x215.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></figure></li></ul>



<h3 class="wp-block-heading">Create a Managed Image from the VHD file</h3>



<p>As we have our VHD file in our Blobs, now it is time to create an Image from the file. We are going to write some PowerShell commands to do the work for us. To set the configuration we are going to use the command  <em>New-AzImageConfig</em>. If you are getting the error &#8220;The term <em>New-AzImageConfig</em> &#8216; is not recognized as the name of a cmdlet&#8221;, you should install and import the module Az<g class="gr_ gr_336 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" id="336" data-gr-id="336">.Compute</g>.</p>



<pre class="wp-block-code"><code>Install-Module Az.Compute
import-module Az.Compute</code></pre>



<p>It is possible to get some additional error when you try to install the Az<g class="gr_ gr_5 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style replaceWithoutSep" id="5" data-gr-id="5">.Compute</g> module.&nbsp;In that case, you can try the preceding command.</p>



<pre class="wp-block-code"><code> Install-Module Az.Compute -AllowClobber</code></pre>



<p>Once that is done, we can set some variables in the PowerShell as follows. </p>



<pre class="wp-block-code"><code>$vmName = "ucs"
$rgName = "ucs"
$location = "West Europe"
$imageName = "ucs"
$osVhdUri = "https://ucs.blob.core.windows.net/files/ucs.vhd"</code></pre>



<p>Now we can start the image creation as preceding. </p>



<pre class="wp-block-code"><code>$imageConfig = New-AzImageConfig -Location $location
$imageConfig = Set-AzImageOsDisk -Image $imageConfig -OsType Linux -OsState Generalized -BlobUri $osVhdUri
$image = New-AzImage -ImageName $imageName -ResourceGroupName $rgName -Image $imageConfig</code></pre>



<p>As the UCS is a Linux based system, I had given the -OsType as Linux, you may have to change it as per your needs. If you are trying to run the command New-AzImage with the VHDX blob, you will get an error as below.</p>



<pre class="wp-block-code"><code>New-AzImage : Blob name in URL https://ucs.blob.core.windows.net/files/ucs.vhdx must end with ".vhd" extension.
ErrorCode: InvalidParameter
ErrorMessage: Blob name in URL https://ucs.blob.core.windows.net/files/ucs.vhdx must end with ".vhd" extension.
ErrorTarget: blobUri
StatusCode: 400
ReasonPhrase: Bad Request
OperationID : 668b8e66-85b3-4c7b-a182-4f155e16b66d
At line:1 char:10
+ $image = New-AzImage -ImageName $imageName -ResourceGroupName $rgName ...
+          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzImage], ComputeCloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Automation.NewAzureRmImage</code></pre>



<p>But we don&#8217;t need to worry about it as we already converted our VHDX file to VHD format. Once the New-AzImage command is successful, you can see the image in the Azure portal if you go to the Images section. You can search for the keyword &#8220;Images&#8221; in the portal.</p>



<h3 class="wp-block-heading">Create a VM from the Managed Image</h3>



<p>As we have the image now, we can create our VM easily from the Azure portal. Go to the Images and select your image and then click on the button +Create VM. In the next page, you can give the details of your VM. You can also create the VM by using the PowerShell command as preceding.</p>



<pre class="wp-block-code"><code>New-AzVm `
    -ResourceGroupName "myResourceGroup" `
    -Name "myVMfromImage" `
    -ImageName "myImage" `
    -Location "East US" `
    -VirtualNetworkName "myImageVnet" `
    -SubnetName "myImageSubnet" `
    -SecurityGroupName "myImageNSG" `
    -PublicIpAddressName "myImagePIP" `
    -OpenPorts 3389</code></pre>



<ul class="wp-block-gallery columns-1 is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex"><li class="blocks-gallery-item"><figure><img decoding="async" width="747" height="664" src="https://sibeeshpassion.com/wp-content/uploads/2019/02/Create-VM-from-the-Image.png" alt="" data-id="13625" data-link="https://sibeeshpassion.com/?attachment_id=13625" class="wp-image-13625" srcset="/wp-content/uploads/2019/02/Create-VM-from-the-Image.png 747w, /wp-content/uploads/2019/02/Create-VM-from-the-Image-300x267.png 300w, /wp-content/uploads/2019/02/Create-VM-from-the-Image-400x356.png 400w, /wp-content/uploads/2019/02/Create-VM-from-the-Image-675x600.png 675w" sizes="(max-width: 747px) 100vw, 747px" /></figure></li></ul>



<p>Once you had filled all the details, you can either click on the Review+Create or you can go through each step. The creation of VM can take a few minutes. Once the task is done, you can go to your Virtual Machine and spin up the same. I would also recommend you to assign a static IP and DNS name to your VM. </p>



<ul class="wp-block-gallery columns-1 is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex"><li class="blocks-gallery-item"><figure><img decoding="async" width="457" height="391" src="https://sibeeshpassion.com/wp-content/uploads/2019/02/VM-IP-configuration.png" alt="" data-id="13626" data-link="https://sibeeshpassion.com/?attachment_id=13626" class="wp-image-13626" srcset="/wp-content/uploads/2019/02/VM-IP-configuration.png 457w, /wp-content/uploads/2019/02/VM-IP-configuration-300x257.png 300w, /wp-content/uploads/2019/02/VM-IP-configuration-400x342.png 400w" sizes="(max-width: 457px) 100vw, 457px" /></figure></li></ul>



<h2 class="wp-block-heading">Conclusion</h2>



<p>In this article, we have learned,</p>



<ul class="wp-block-list"><li>What are VHDX and VHD files</li><li>How to convert the VHDX file to VHD</li><li>How to upload VHD files to Azure Blob storage</li><li>How to create Managed Image from the VHD file in Azure</li><li>How to create Virtual Machine using the Managed Image</li></ul>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>Thanks a lot for reading. Did I miss anything that you may think which is needed in this article? Could you find this post as useful? Kindly do not forget to share me your feedback.</p>



<p>Kindest Regards<br>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/creating-an-azure-vm-from-the-vhdx-vhd-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Raspberry PI SD Card Provisioning with Windows 10 IoT Core &#8211; Create FFU Image and Flash</title>
		<link>https://www.sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-create-ffu-image-and-flash/</link>
					<comments>https://www.sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-create-ffu-image-and-flash/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 22 Nov 2018 08:41:04 +0000</pubDate>
				<category><![CDATA[IoT]]></category>
		<category><![CDATA[Raspberry PI]]></category>
		<category><![CDATA[diskpart]]></category>
		<category><![CDATA[DISM]]></category>
		<category><![CDATA[IoT Core]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Raspberry PI SD Card Provisioning]]></category>
		<category><![CDATA[Windows 10 IoT Core]]></category>
		<category><![CDATA[Windows IoT core by DISM]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=13388</guid>

					<description><![CDATA[[toc] Introduction In my previous article, we have seen how to Set Up Your Raspberry PI with Microsoft Windows 10 IoT Core. Yes, we were successful in flashing the Microsoft Windows 10 IoT Core OS to our Raspberry PI, but let&#8217;s try something very handy this time. The main topic we are going to discuss here in this article is SD Card Provisioning. I understand that you have one Raspberry PI with a working OS in it, whether it is a Microsoft IoT  OS or Raspbian. And you might also have an application which runs in your Raspberry Pi. That&#8217;s good. But [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Introduction</h2>
<p>In my previous article, we have seen how to <a href="https://sibeeshpassion.com/setting-up-your-raspberry-pi-with-microsoft-windows-10-iot-core/">Set Up Your Raspberry PI with Microsoft Windows 10 IoT Core</a>. Yes, we were successful in flashing the Microsoft Windows 10 IoT Core OS to our <a href="https://sibeeshpassion.com/category/raspberry-pi/">Raspberry PI</a>, but let&#8217;s try something very handy this time. The main topic we are going to discuss here in this article is <em>SD Card Provisioning.</em> I understand that you have one Raspberry PI with a working OS in it, whether it is a Microsoft IoT  OS or Raspbian. And you might also have an application which runs in your Raspberry Pi. That&#8217;s good. But what if you have 100 Raspberry PI and you need to set up your Raspberry PIs for a production environment? Did you get the difficulties in your mind? In this article, we are going to start a series of articles on SD Card Provisioning. For now, let&#8217;s just start doing some amazing things. Let&#8217;s just start then.</p>
<h2>Background</h2>
<p>Yeah, I am glad that you have a Raspberry PI with Windows 10 IoT core OS. While setting up your OS, you might have downloaded the IoT Dashboard and flashed the IoT OS to your SD card manually. As I mentioned in the Introduction, this is not a normal scenario when you want to connect multiple (let&#8217;s say 100) Raspberry PIs. Flashing the OS by using the Dashboard application might not be a good idea in this case. What should we do then? That&#8217;s where PowerShell come into the play. Yes, we are going to try out some PowerShell commands to do all those mentioned jobs for us.</p>
<h2>Prerequisites</h2>
<p>To do the wonderful things, we always need some prerequisites.  You can always see all the prerequisites from <a href="https://docs.microsoft.com/en-us/windows-hardware/manufacture/iot/set-up-your-pc-to-customize-iot-core">here</a>. But, in this part, we are going to be needed only the preceding tools.</p>
<ol>
<li>Windows Assessment and Deployment Kit (Windows ADK)</li>
<li>Windows Driver Kit (WDK) 10</li>
<li>IoT Core ADK Add-Ons</li>
<li>Windows 10 IoT Core Packages</li>
<li>The Raspberry Pi BSP</li>
</ol>
<h2>Creating the Base Windows IoT FFU Image</h2>
<p>I assume that you had already gone through the Prerequisites and followed the instructions. If not, please check again.</p>
<h3>Create a Workspace</h3>
<p>To get started here, please go to the cloned location of the repository iot-adk-addonkit, where you will find a Windows Command Script IoTCorePShell.cmd. Double click on the same file will open a PowerShell with administrative privilege. Now, this is where the game starts. Once it opens it will do some initial process for us.</p>
<p><div id="attachment_13389" style="width: 661px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_.png"><img decoding="async" aria-describedby="caption-attachment-13389" class="size-full wp-image-13389" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_.png" alt="Running IoTCorePShell.cmd" width="651" height="230" srcset="/wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_.png 651w, /wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_-300x106.png 300w, /wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_-400x141.png 400w" sizes="(max-width: 651px) 100vw, 651px" /></a><p id="caption-attachment-13389" class="wp-caption-text">Running IoTCorePShell.cmd</p></div></p>
<p>Now let&#8217;s create a workspace now.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">New-IoTWorkspace C:\Workspacefolder oemname arm
(or) new-ws C:\workspacefolder oemname arm</pre>
<p><div id="attachment_13390" style="width: 661px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/new-ws-command.png"><img decoding="async" aria-describedby="caption-attachment-13390" class="size-full wp-image-13390" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/new-ws-command.png" alt="new-ws command" width="651" height="340" srcset="/wp-content/uploads/2018/11/new-ws-command.png 651w, /wp-content/uploads/2018/11/new-ws-command-300x157.png 300w, /wp-content/uploads/2018/11/new-ws-command-400x209.png 400w" sizes="(max-width: 651px) 100vw, 651px" /></a><p id="caption-attachment-13390" class="wp-caption-text">new-ws command</p></div></p>
<p>Now we have created a workspace successfully. Please be noted that the BSPPKG_DIR is &#8220;C:\Program Files (x86)\Windows Kits\10\MSPackages\retail\arm\fre&#8221;. I strongly recommend you to check that folder whether you have contents in it or not if there is no content you might haven&#8217;t installed the packages mentioned in the prerequisites.</p>
<h3>Build BSP</h3>
<p>Now it is time to think about the BSP aka Board Support Package. As we already know that we are using Raspberry PI, we can directly download the RPi_BSP.zip file from the <a href="https://github.com/ms-iot/iot-adk-addonkit/releases">GitHub release page</a>. Then you can perform the below commands.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Import-IoTBSP RPi2 C:\Downloads\RPi_BSP.zip
(or) importbsp RPi2 C:\Downloads\RPi_BSP.zip
buildpkg RPi2</pre>
<p>If everything is right, you should see an output as below.</p>
<p><div id="attachment_13391" style="width: 663px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Import-Raspberry-BSP.png"><img decoding="async" aria-describedby="caption-attachment-13391" class="size-full wp-image-13391" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Import-Raspberry-BSP.png" alt="Import Raspberry BSP" width="653" height="92" srcset="/wp-content/uploads/2018/11/Import-Raspberry-BSP.png 653w, /wp-content/uploads/2018/11/Import-Raspberry-BSP-300x42.png 300w, /wp-content/uploads/2018/11/Import-Raspberry-BSP-400x56.png 400w" sizes="(max-width: 653px) 100vw, 653px" /></a><p id="caption-attachment-13391" class="wp-caption-text">Import Raspberry BSP</p></div></p>
<h3>Build Packages</h3>
<p>Once you have created the workspace and extracted the BSP, it is time to build all of our packages.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">New-IoTCabPackage All
(or) buildpkg all</pre>
<p>If you miss this step before you go to the next step, you will get an error as follows when you build your image.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">info: Trying to load file 'C:\OEEWorkspace\Build\arm\InputFMs\OEMFMFileList.xml' as a FM file list ... fatal error : Error: Missing package: C:\OEEWorkspace\Build\arm\pkgs\test.OEM.Sample.cab
info: Trying to load file 'C:\OEEWorkspace\Build\arm\InputFMs\RPi2FMFileList.xml' as a FM file list ... fatal error : Error: Missing package: 
</pre>
<p>You will also end up in the similar <a href="https://github.com/ms-iot/iot-adk-addonkit/issues/139">GitHub issue</a>. Trust me, finding the root cause of this issue took me some hours and at the end, I answered my findings here in <a href="https://stackoverflow.com/questions/53414482/info-trying-to-load-file-oemfmfilelist-xml-as-a-fm-file-list-fatal-error/53414483#53414483">StackOverflow</a>.</p>
<p><div id="attachment_13392" style="width: 436px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Building-all-the-packages.png"><img decoding="async" aria-describedby="caption-attachment-13392" class="size-full wp-image-13392" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Building-all-the-packages.png" alt="Building all the packages" width="426" height="385" srcset="/wp-content/uploads/2018/11/Building-all-the-packages.png 426w, /wp-content/uploads/2018/11/Building-all-the-packages-300x271.png 300w, /wp-content/uploads/2018/11/Building-all-the-packages-400x362.png 400w" sizes="(max-width: 426px) 100vw, 426px" /></a><p id="caption-attachment-13392" class="wp-caption-text">Building all the packages</p></div></p>
<p>Once the build is successful, you should be able to see the cab files in your workspace location, in my case, it is C:\OEE\Build\arm\pkgs.</p>
<h3>Create a Product</h3>
<p>Now let&#8217;s create a new Product, consider this as the device for which we are building an image for. We will be using the BSP we have extracted for this step.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Add-IoTProduct ProductA RPi2
(or) newproduct MyProductA RPi2</pre>
<p>You will be asked the Manufacturer Name (OEM Name), Family, SKU, BaseboardManufacturer, and BaseboardProduct. You can get the BaseProductName from your Workspace location, in my case C:\OEE\Source-arm\BSP. You can see the sample command here in the preceding image.</p>
<p><div id="attachment_13393" style="width: 659px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Creating-a-new-Product.png"><img decoding="async" aria-describedby="caption-attachment-13393" class="size-full wp-image-13393" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Creating-a-new-Product.png" alt="Creating a new Product" width="649" height="210" srcset="/wp-content/uploads/2018/11/Creating-a-new-Product.png 649w, /wp-content/uploads/2018/11/Creating-a-new-Product-300x97.png 300w, /wp-content/uploads/2018/11/Creating-a-new-Product-400x129.png 400w" sizes="(max-width: 649px) 100vw, 649px" /></a><p id="caption-attachment-13393" class="wp-caption-text">Creating a new Product</p></div></p>
<p>The command shown in the image will generate a new Product in the Workspace location C:\OEE\Source-arm\Products\OEEIoTCore.</p>
<p><div id="attachment_13394" style="width: 564px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Add-IoTProduct-Output.png"><img decoding="async" aria-describedby="caption-attachment-13394" class="size-full wp-image-13394" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Add-IoTProduct-Output.png" alt="" width="554" height="412" srcset="/wp-content/uploads/2018/11/Add-IoTProduct-Output.png 554w, /wp-content/uploads/2018/11/Add-IoTProduct-Output-300x223.png 300w, /wp-content/uploads/2018/11/Add-IoTProduct-Output-400x297.png 400w" sizes="(max-width: 554px) 100vw, 554px" /></a><p id="caption-attachment-13394" class="wp-caption-text">Add-IoTProduct Output</p></div></p>
<h3>Build the Image</h3>
<p>We are almost done, let&#8217;s eject all the removable devices from the system and then run the below command.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">New-IoTFFUImage &lt;product name&gt; Test
(or)buildimage &lt;product name&gt; Test</pre>
<p>This command will give you the FFU image with your base image.</p>
<p><div id="attachment_13396" style="width: 660px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File.png"><img decoding="async" aria-describedby="caption-attachment-13396" class="size-full wp-image-13396" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File.png" alt="Building Image and Generate FFU File" width="650" height="432" srcset="/wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File.png 650w, /wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File-300x199.png 300w, /wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File-400x266.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-13396" class="wp-caption-text">Building Image and Generate FFU File</p></div></p>
<p>You can also see the logs in your workspace location in the build folder. The generated FFU image(Flash.ffu) will be available at C:\OEE\Build\arm\OEEIoTCore\Test folder.</p>
<h2>Writing/Flashing the FFU Image to SD Card</h2>
<p>Wow!, now we have a fully functional FFU image and the only thing pending is to write some bat commands to flash it to SD card, you can use the <a href="https://docs.microsoft.com/en-us/windows/iot-core/connect-your-device/dism">DISM</a>. Let&#8217;s create a text file called format.txt and write some commands as preceding.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">select disk 1
clean
create partition primary
select partition 1
active
format fs=fat32 quick
assign
exit
</pre>
<p>As you can see that we are selecting the disk 1, considering the fact that only one removable disk is been connected to your machine.  Then we format the disk. This format.txt file will be used in our bat file write.bat.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">echo off
REM Start formatting
diskpart /s format.txt &gt;log.txt

REM Start flashing
dism.exe /Apply-Image /ImageFile:Flash.ffu /ApplyDrive:\\.\PhysicalDrive1 /SkipPlatformCheck /Quiet

ECHO Finish
</pre>
<p>The logs will be added to the file called log.txt. The command ImageFile:Flash.ffu is the place where we assign our FFU image. Now let&#8217;s just go to the folder where these three files are been placed and open a command prompt in administrative power.</p>
<ul>
<li>write.bat</li>
<li>format.txt</li>
<li>flash.ffu</li>
</ul>
<p><div id="attachment_13399" style="width: 659px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands.png"><img decoding="async" aria-describedby="caption-attachment-13399" class="size-full wp-image-13399" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands.png" alt="Flash IoT Core by Commands" width="649" height="250" srcset="/wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands.png 649w, /wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands-300x116.png 300w, /wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands-400x154.png 400w" sizes="(max-width: 649px) 100vw, 649px" /></a><p id="caption-attachment-13399" class="wp-caption-text">Flash IoT Core by Commands</p></div></p>
<h2>Connect SD Card to Raspberry PI and then Raspberry PI to the Network</h2>
<p>Now that our OS is flashed and it is time to connect the SD card to the Raspberry PI and connect a monitor, mouse, keyboard, ethernet to the Raspberry PI. You will see the default IoT core application running. You can also check in the device portal using the IoT Dashboard application, if you are not sure how, please read my previous post.</p>
<h2>Conclusion</h2>
<p>Wow!. Now we have learned,</p>
<ul>
<li>how we can generate the IoT core FFU image using PowerShell</li>
<li>how to write the same to an SD card.</li>
</ul>
<p>Is that all? No, in the next article we will learn</p>
<ul>
<li>how we can add our app package to this FFU image which can be used in many Raspberry PI</li>
<li>how to generate the FFU image on demand with some chained PowerShell commands.</li>
<li>how to use other mechanisms to write the FFU image to the disk</li>
</ul>
<h2><span id="your-turn-what-do-you-think">Your turn. What do you think?</span></h2>
<p>Thanks a lot for reading. Did I miss anything that you may think which is needed in this article? Could you find this post as useful? Kindly do not forget to share me your feedback.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-create-ffu-image-and-flash/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint PnP Provisioning with Data &#8211; Move Your Contents from One Site to Another in SharePoint Online</title>
		<link>https://www.sibeeshpassion.com/sharepoint-pnp-provisioning-with-data-move-your-contents-from-one-site-to-another-in-sharepoint-online/</link>
					<comments>https://www.sibeeshpassion.com/sharepoint-pnp-provisioning-with-data-move-your-contents-from-one-site-to-another-in-sharepoint-online/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 06 Nov 2018 16:18:36 +0000</pubDate>
				<category><![CDATA[Office 365]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[move data between sites in sharepoint]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[sharepoint pnp provisioning]]></category>
		<category><![CDATA[sharepoint powershell commands]]></category>
		<category><![CDATA[SharePoint Tips]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=13341</guid>

					<description><![CDATA[[toc] Introduction I understand that you need to move all of your contents to your destination site from your source site in SharePoint online. You might have done some search in Google and saw this post. Here in this article, I will be walking you through the steps you need to perform the SharePoint PnP provisioning. With the latest SharePoint modern experience, Microsoft had decided to turn off some features, and one among them was Custom Scripting. Unfortunately, to do the SharePoint provisioning, we will have to enable the Custom Scripting. Enough talking, let&#8217;s jump into the coding. I hope you will find [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Introduction</h2>
<p>I understand that you need to move all of your contents to your destination site from your source site in <a href="https://sibeeshpassion.com/category/sharepoint/">SharePoint</a> online. You might have done some search in Google and saw this post. Here in this article, I will be walking you through the steps you need to perform the SharePoint PnP provisioning. With the latest SharePoint modern experience, Microsoft had decided to turn off some features, and one among them was Custom Scripting. Unfortunately, to do the SharePoint provisioning, we will have to enable the Custom Scripting. Enough talking, let&#8217;s jump into the coding. I hope you will find this post useful.</p>
<h2>Before you start Provisioning your site</h2>
<p>Before you jump into the process of provisioning there is some configuration which you must perform.</p>
<ul>
<li>Enable the Custom Scripting</li>
<li>Set the User as a Term Store Admin</li>
</ul>
<h3>Enable the Custom Scripting</h3>
<p>With the latest release, Microsoft had deactivated this feature from the modern SharePoint experience thus we would have to enable it manually. According to Microsoft, below are the features which will not be available until you manually enable the custom scripting.</p>
<ol>
<li>Save Site as Template</li>
<li>Save document library as template</li>
<li>Solution Gallery</li>
<li>Theme Gallery</li>
<li>Help Settings</li>
<li>HTML Field Security</li>
<li>Sandbox solutions</li>
<li>SharePoint Designer</li>
<li>Uploading files that potentially include script</li>
</ol>
<p>In our case, we wanted to do SharePoint PnP provisioning, and it is interesting that it is not mentioned anywhere that we need to enable custom scripting to do SharePoint PnP provisioning. You can always enable the Custom Scripting in two ways, one is using the portal, and another is to use PowerShell commands. I would prefer using the PowerShell commands as it will enable the custom scripting right away. If you enable the custom scripting via the portal, it will take 24 hours to get it activated.</p>
<p id="to-allow-custom-script-on-other-sharepoint-site-collections" class="heading-with-anchor">To allow custom script on other SharePoint site collections, you will have to download the download the latest SharePoint Online Management Shell. Once you are done you can perform the below commands.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Connect-SPOService -Url https://yoursharepoint-admin.sharepoint.com</pre>
<p>The above command will connect your SharePoint admin site, please be noted that you should have a tenant admin access to do this. If you don&#8217;t have the access, you should consider getting the access or you can request the tenant admin to do the same.</p>
<p>Once you are connected, you can perform the preceding command.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Set-SPOsite https://yoursharepinttenant.sharepoint.com/sites/yoursharepointsite -DenyAddAndCustomizePages 0
</pre>
<p>The above command will enable the custom scripting for the site you have mentioned. To check this, you can always go to any of your site collection/list settings, and if you see the option save the list as a template, it is done and you can proceed.</p>
<p><div id="attachment_13342" style="width: 288px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Save-list-as-template.png"><img decoding="async" aria-describedby="caption-attachment-13342" class="size-full wp-image-13342" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Save-list-as-template.png" alt="Save list as template" width="278" height="300" /></a><p id="caption-attachment-13342" class="wp-caption-text">Save list as the template</p></div></p>
<h3>Set the User as a Term Store Admin</h3>
<p>Once we have enabled the custom scripting it is time to add you as the Term Store Admin, again you can always reach out to your Tenant admin to add you as a Term Store Admin. You can ask your Tenant admin to perform the preceding steps.</p>
<ol>
<li>
<p class="">Sign in to Office 365 as a global admin or SharePoint admin.</p>
</li>
<li>Click on the app launch icon( 9 dots) and then click on Admin to open the Microsoft 365 admin center.</li>
<li>Select Admin centers and then click on SharePoint.</li>
<li>Now, you should see an option as Term Store and click on it.</li>
<li>He/She can add your mail id in the text box near to the heading Term Store Administrators</li>
</ol>
<p>Once it is done you can always go to your Site Settings &gt; Term Store Management &gt; Term Store Administrators.</p>
<h2>Start SharePoint PnP Provisioning</h2>
<p>Wow!. We have done all the configuration and now we can start doing the provisioning.</p>
<h3>Connect your source site</h3>
<p>The first thing to do is, to connect the source SharePoint site, you can do that by using the preceding command.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Connect-PnPOnline https://youradmin.sharepoint.com/sites/yoursite/</pre>
<h3>Generate a provisioning template</h3>
<p>Now we can generate a provisioning template from the web. You can do that by doing the command below.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Get-PnPProvisioningTemplate -Out c:/Provisioning/template.xml</pre>
<p>Please be noted that this will create a new folder &#8220;Provisioning&#8221; in the C drive and then place the template.xml in it. You can always see the other options of Get-Pn<wbr />PProvisioning<wbr />Template <a href="https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/get-pnpprovisioningtemplate?view=sharepoint-ps">here.</a> This command will pull almost everything from the source site, and you can always choose what exactly you need to take from the source site. <strong>This will not retrieve the data, you will have to use another command for that</strong>.</p>
<h3>Add data to the provisioning template</h3>
<p>As we have seen that the Get-Pn<wbr />PProvisioning<wbr />Template will not retrieve the data with the list, we will have to use Add-Pn<wbr />PData<wbr />Rows<wbr />ToProvisioning<wbr />Template command to do that magic.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Add-PnPDataRowsToProvisioningTemplate -Path c:/Provisioning/template.xml -List 'The list name' -Query '&lt;view&gt;&lt;/view&gt;'</pre>
<p>Please see <a href="https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/add-pnpdatarowstoprovisioningtemplate?view=sharepoint-ps">here</a> to see the other options you can use with the Add-Pn<wbr />PData<wbr />Rows<wbr />ToProvisioning<wbr />Template command. Please be noted that the size of the template.xml file will be larger as per the data you have in the source list.</p>
<h3>Apply provision to your destination site</h3>
<p>Now we have an XML file which has everything we need to move. Let&#8217;s just do it then. Connect your destination site by following the command below.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Connect-PnPOnline https://youradmin.sharepoint.com/sites/yourdetinationsite</pre>
<p>Please remember to use the same id and password of your Term Store Admin account.</p>
<p>Once you are connected to the destination site, you can perform the Apply-PnPProvisioningTemplate as follows.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Apply-PnPProvisioningTemplate -Path C:/Provisioning/template.xml</pre>
<p>If you are getting an error as &#8221; Apply-PnPProvisioningTemplate : The parent content type specified by content type identifier does not exist&#8221;, you will have to enable the <strong>SharePoint Server Publishing feature</strong> in the Site Settings &gt; Site Features. Remember to enable the <strong>SharePoint Server Publishing Infrastructure</strong> under Site Settings &gt; Site Collection Features before you enable the SharePoint Server Publishing feature in the Site Settings. It is a dependency. You can always see my StackExchange answer <a href="https://sharepoint.stackexchange.com/questions/154239/the-parent-content-type-specified-by-content-type-identifier-ct-id-does-not-ex/251856#251856">here</a>.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Apply-PnPProvisioningTemplate : The parent content type specified by content type identifier does not exist.
At line:1 char:1
+ Apply-PnPProvisioningTemplate -Path C:\Provisioning\template.xml
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Apply-PnPProvisioningTemplate], ServerException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.ApplyProvisioningTemplate
</pre>
<p>Please be noted that you will also get an error as &#8220;WARNING: ListInstance Style Library is a Style Library of a site with NoScript enabled and will be skipped&#8221; if the custom scripting is not enabled.</p>
<p>You will also get an error as &#8220;Access denied. You do not have permission to perform this action or access this resource&#8221; if you don&#8217;t have Term Store Admin permission.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Apply-PnPProvisioningTemplate : Access denied. You do not have permission to perform this action or access this resource.
At line:1 char:1
+ Apply-PnPProvisioningTemplate -Path C:/Provisioning/template.xml
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Apply-PnPProvisioningTemplate], ServerUnauthorizedAccessException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.ApplyProvisioningTemplate
</pre>
<p>Once you run the Apply-PnPProvisioningTemplate command, and if everything is fine, you will get everything in your destination site. It will take some time to generate everything for you and add the data to it, depends on the amount of the data you have the process can take from 5 minutes to hours.</p>
<h2><span id="conclusion_1"><span id="conclusion">Conclusion</span></span></h2>
<p>Congratulation, we have successfully moved all of our data and almost everything from one SharePoint site to other. In this article, we have learned how to,</p>
<ol>
<li>Enable Custom Scripting in SharePoint</li>
<li>Add a Term Site Admin</li>
<li>Connect to a SharePoint site</li>
<li>Create a PnP provisioning template from the web</li>
<li>Add data to your Provisioning template form the lists</li>
<li>Apply the provisioning to the destination SharePoint site</li>
</ol>
<h2><span id="your-turn-what-do-you-think">Your turn. What do you think?</span></h2>
<p>Thanks a lot for reading. I will come back with another post on the same topic very soon. Did I miss anything that you may think which is needed? Could you find this post as useful? Kindly do not forget to share me your feedback.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/sharepoint-pnp-provisioning-with-data-move-your-contents-from-one-site-to-another-in-sharepoint-online/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
