<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://thecastle.me.uk/index.php?action=history&amp;feed=atom&amp;title=Azure</id>
	<title>Azure - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://thecastle.me.uk/index.php?action=history&amp;feed=atom&amp;title=Azure"/>
	<link rel="alternate" type="text/html" href="https://thecastle.me.uk/index.php?title=Azure&amp;action=history"/>
	<updated>2026-05-05T23:25:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://thecastle.me.uk/index.php?title=Azure&amp;diff=6563&amp;oldid=prev</id>
		<title>Williamgray ywa14u61 at 13:39, 3 November 2021</title>
		<link rel="alternate" type="text/html" href="https://thecastle.me.uk/index.php?title=Azure&amp;diff=6563&amp;oldid=prev"/>
		<updated>2021-11-03T13:39:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:39, 3 November 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/del&gt;Install&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;= &lt;/ins&gt;Install&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#Install-Module AzureADPreview&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#Install-Module AzureADPreview&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/del&gt;Update&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;= &lt;/ins&gt;Update&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#Update-Module AzureADPreview&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#Update-Module AzureADPreview&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;*&lt;/del&gt;Connect to Azure AD&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;Connect to Azure AD&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Connect-AzureAD&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Connect-AzureAD&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Run the following commands:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Run the following commands:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l36&quot; &gt;Line 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 36:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Steps from Start azure scripting&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;Steps from Start azure scripting&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Run powershell as administrator&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Run powershell as administrator&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Williamgray ywa14u61</name></author>
		
	</entry>
	<entry>
		<id>https://thecastle.me.uk/index.php?title=Azure&amp;diff=6562&amp;oldid=prev</id>
		<title>Williamgray ywa14u61 at 13:38, 3 November 2021</title>
		<link rel="alternate" type="text/html" href="https://thecastle.me.uk/index.php?title=Azure&amp;diff=6562&amp;oldid=prev"/>
		<updated>2021-11-03T13:38:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
* Install&lt;br /&gt;
#Install-Module AzureADPreview&lt;br /&gt;
&lt;br /&gt;
* Update&lt;br /&gt;
#Update-Module AzureADPreview&lt;br /&gt;
&lt;br /&gt;
*Connect to Azure AD:&lt;br /&gt;
# Connect-AzureAD&lt;br /&gt;
# Run the following commands:&lt;br /&gt;
# $setting=(Get-AzureADDirectorySetting | where -Property DisplayName -Value &amp;quot;Group.Unified&amp;quot; -EQ)&lt;br /&gt;
# if ($setting -eq $null)&lt;br /&gt;
# {&lt;br /&gt;
# $template = Get-AzureADDirectorySettingTemplate -Id 62375ab9-6b52-47ed-826b-58e47e0e304b&lt;br /&gt;
# $setting = $template.CreateDirectorySetting()&lt;br /&gt;
# $setting[&amp;quot;EnableMIPLabels&amp;quot;] = &amp;quot;True&amp;quot;&lt;br /&gt;
# New-AzureADDirectorySetting -DirectorySetting $setting&lt;br /&gt;
# }else{&lt;br /&gt;
# $setting[&amp;quot;EnableMIPLabels&amp;quot;] = &amp;quot;True&amp;quot;&lt;br /&gt;
# Set-AzureADDirectorySetting -Id $setting.Id -DirectorySetting $setting&lt;br /&gt;
# }&lt;br /&gt;
&lt;br /&gt;
If you already have the ClassificationList item, this will be automatedly disabled. Even the DefaultLabel if that is configured. When public preview is enabled you need to do a sync with following commands. First connect to the SSC portal.&lt;br /&gt;
# Set-ExecutionPolicy RemoteSigned&lt;br /&gt;
# $UserCredential = Get-Credential&lt;br /&gt;
# $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.compliance.protection.outlook.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection&lt;br /&gt;
# Import-PSSession $Session -DisableNameChecking&lt;br /&gt;
# Execute-AzureAdLabelSync&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps from Start azure scripting&lt;br /&gt;
&lt;br /&gt;
Run powershell as administrator&lt;br /&gt;
&lt;br /&gt;
Then enter&lt;br /&gt;
Install-Module -Name AzureRM -AllowClobber&lt;br /&gt;
&lt;br /&gt;
Say Y to install modules (it may ask to install NuGet also)&lt;br /&gt;
&lt;br /&gt;
This will install the Azure module, which only needs to be done once&lt;br /&gt;
&lt;br /&gt;
Then enter&lt;br /&gt;
Set-ExecutionPolicy -ExecutionPolicy ByPass&lt;br /&gt;
&lt;br /&gt;
This will allow you to run your own scripts from your PC&lt;br /&gt;
*** Warning ! It will allow you to run ANY script which can be dangerous. You take full responsibility for this. ***&lt;br /&gt;
&lt;br /&gt;
Now switch to a normal powershell session&lt;br /&gt;
&lt;br /&gt;
Enter&lt;br /&gt;
Import-Module -Name AzureRM&lt;br /&gt;
Now run Azure commands and scripts (this can be in the script)&lt;br /&gt;
&lt;br /&gt;
Disks must be unmanaged to allow them to be in a storage account &amp;amp; container.&lt;br /&gt;
&lt;br /&gt;
Create a VM Machine :-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click the &amp;gt;_ to open the powershell window&lt;br /&gt;
&lt;br /&gt;
For a new account it will say no storage, you will need to choose the Free Trial Subscription&lt;br /&gt;
Choose Advanced Settings to choose the Cloud Shell Region&lt;br /&gt;
&lt;br /&gt;
New-AzureRmVm ` -ResourceGroupName &amp;quot;wgresourcegroup&amp;quot; ` -Name &amp;quot;WG-AD-Server&amp;quot; ` -Location &amp;quot;North Europe&amp;quot; ` -VirtualNetworkName &amp;quot;WG-VNet&amp;quot; ` -SubnetName &amp;quot;WG-Subnet&amp;quot; ` -SecurityGroupName &amp;quot;WG-Security-Group&amp;quot; ` -PublicIpAddressName &amp;quot;WG-AD-Server-IPName&amp;quot; ` -OpenPorts 80,3389&lt;br /&gt;
&lt;br /&gt;
(administrator not allowed) For User enter : wgadmin&lt;br /&gt;
For Password enter a created Password : ….&lt;br /&gt;
&lt;br /&gt;
Once created&lt;br /&gt;
&lt;br /&gt;
Get-AzureRmPublicIpAddress -ResourceGroupName &amp;quot;wgresourcegroup&amp;quot; | Select &amp;quot;IpAddress&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#For exchange powershell get mailboxes&lt;br /&gt;
&lt;br /&gt;
# Run Powershell as administrator&lt;br /&gt;
&lt;br /&gt;
Set-ExecutionPolicy RemoteSigned&lt;br /&gt;
winrm get winrm/config/client/auth&lt;br /&gt;
$UserCredential = Get-Credential&lt;br /&gt;
&lt;br /&gt;
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection&lt;br /&gt;
Import-PSSession $Session -DisableNameChecking&lt;br /&gt;
&lt;br /&gt;
# Get last login times to licensed mailboxes that have logged in since 18/4/2020 20:00:00&lt;br /&gt;
get-mailbox -RecipientTypeDetails UserMailbox | Where-Object {$_.skuassigned -eq $true} | Get-MailboxStatistics | Where-Object {$_.LastLogonTime -gt &amp;#039;2020-04-18 20:00:00&amp;#039;} | Select DisplayName, LastLogonTime | fl&lt;br /&gt;
&lt;br /&gt;
# Get last login times to licensed mailboxes that have not logged in since 18/4/2020 20:00:00&lt;br /&gt;
get-mailbox -RecipientTypeDetails UserMailbox | Where-Object {$_.skuassigned -eq $true} | Get-MailboxStatistics | Where-Object {$_.LastLogonTime -lt &amp;#039;2020-04-18 20:00:00&amp;#039;} | Select DisplayName, LastLogonTime | fl&lt;br /&gt;
&lt;br /&gt;
# Get licensed mailboxes where user has not logged in&lt;br /&gt;
get-mailbox -RecipientTypeDetails UserMailbox | Where-Object {$_.skuassigned -eq $true} | Get-MailboxStatistics | Where-Object {$_.LastLogonTime -eq $null} |Select DisplayName, LastLogonTime | fl&lt;br /&gt;
&lt;br /&gt;
# Get unlicensed mailboxes where user has not logged in&lt;br /&gt;
get-mailbox -RecipientTypeDetails UserMailbox | Where-Object {$_.skuassigned -ne $true} | Get-MailboxStatistics | Where-Object {$_.LastLogonTime -eq $null} |Select DisplayName, LastLogonTime | fl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Logout of the session&lt;br /&gt;
Remove-PSSession $Session&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Azure&lt;br /&gt;
&lt;br /&gt;
=Get Resources Info=&lt;br /&gt;
&lt;br /&gt;
Get-AzureRmResource|Sort-Object ResourceGroupName,ResourceType | Format-Table -AutoSize ResourceGroupName,ResourceType,Name,Location |Out-String -Width 4096 |Out-File AzureInfo.csv&lt;br /&gt;
&lt;br /&gt;
=Get Network Security Group Info=&lt;br /&gt;
&lt;br /&gt;
Get-AzureRmResource -ResourceType Microsoft.Network/networkSecurityGroups | ForEach-&lt;br /&gt;
Object -Process { Get-AzureRmNetworkSecurityGroup -Name $_.Name -ResourceGroupName $_.ResourceGroupName | Get-AzureRmNet&lt;br /&gt;
workSecurityRuleConfig | Select * | Format-Table -AutoSize Name,Priority,SourceAddressPrefix,DestinationAddressPrefix,P&lt;br /&gt;
rotocol,DestinationPortRange,$_.Name,$_.ResourceGroupName } | Out-String -Width 4096 |Out-File NSGInfo.csv&lt;br /&gt;
&lt;br /&gt;
=Get Hardware Info=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get-AzureRmVM |ForEach-Object -Process { `&lt;br /&gt;
$vmname=$_.Name;`&lt;br /&gt;
$rgn=$_.ResourceGroupName;`&lt;br /&gt;
$size=(Get-AzureRmVM -ResourceGroupName $rgn -Name $vmname).HardwareProfile.VmSize ;`&lt;br /&gt;
$vms=( Get-AzureRmVMSize -location $_.Location | ?{ $_.Name -eq $size } ) ; `&lt;br /&gt;
$outvar=@{ ResGroup = $rgn ; VMName = $vmname ; VMImage = $vms.Name ; Cores = $vms.NumberOfCores ; Memory=$vms.MemoryInMb }; `&lt;br /&gt;
New-Object PSObject -Property $outvar|Export-CSV -Append -Path &amp;quot;HardwareInfo.csv&amp;quot; -NoTypeInformation }&lt;br /&gt;
&lt;br /&gt;
=Get disk info=&lt;br /&gt;
&lt;br /&gt;
$diskinfo=@() ; Get-AzureRmVM |ForEach-Object -Process { $di= $_.StorageProfile.DataDisks ;`&lt;br /&gt;
$di|Add-Member VMName $_.Name ;`&lt;br /&gt;
$diskinfo += $di;`&lt;br /&gt;
$di = $_.StorageProfile.OSDisk ;`&lt;br /&gt;
$di|Add-Member VMName $_.Name ;`&lt;br /&gt;
$diskinfo += $di };$diskinfo |Export-CSV -Path DiskInfo&lt;br /&gt;
&lt;br /&gt;
=Get IP Info=&lt;br /&gt;
&lt;br /&gt;
Get-AzureRmNetworkInterface |ForEach-Object { $name=$_.Name;$outpup=&amp;quot;None&amp;quot;;$privip= $_.IpConfigurations.PrivateIPAddress ; $resId=$_.IpConfigurations.PublicIpAddress.Id; if ($resid){$respub=Get-AzureRmResource -ResourceId $resId ; $rpubip=Get-AzureRmPublicIpAddress -Name $respub.Name -ResourceGroupName $respub.ResourceGroupName; $outpup= $rpubip.IpAddress } ; echo &amp;quot;$name,$privip,$outpup&amp;quot; ;} &amp;gt; IPInfo.csv&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Get Windows Versions=&lt;br /&gt;
&lt;br /&gt;
Get-AzureRmVM | ForEach-Object { $nm=$_.Name;$pub=$_.StorageProfile.ImageReference.Publisher;$offer=$_.StorageProfile.ImageReference.Offer;$os=$_.StorageProfile.ImageReference.Sku;Write-Output &amp;quot;$nm,$pub,$offer,$os&amp;quot; } |Out-File OSVersions.csv&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$vms = Get-AzureRmVM; $nics = Get-AzureRmNetworkInterface | where VirtualMachine -NE $null ; foreach($nic in $nics){`&lt;br /&gt;
    $vm = $vms | where-object -Property Id -EQ $nic.VirtualMachine.id`&lt;br /&gt;
    $prv = $nic.IpConfigurations | select-object -ExpandProperty PrivateIpAddress`&lt;br /&gt;
    $alloc = $nic.IpConfigurations | select-object -ExpandProperty PrivateIpAllocationMethod`&lt;br /&gt;
    Write-Output &amp;quot;$($vm.Name) : $prv , $alloc&amp;quot;`&lt;br /&gt;
}`&lt;/div&gt;</summary>
		<author><name>Williamgray ywa14u61</name></author>
		
	</entry>
</feed>