PowerShell for Azure Active Directory (AAD) and Office 365

Well, this is just some notes on how to prepare PowerShell to manage Azure Active Directory and Office 365. But similar to connecting to AD in Azure, you also need to go through these steps to connect PowerShell to an Azure subscription.

This is quite interesting actually when I put them together. As AAD still has two active environment versions, same as Azure console – Classic and RM – they belong to different logins, a little confusing to admins. Also PowerShell modules need to be installed and updated to enable different cmdlets set in order to manage different products – cloud, non-cloud, 3rd-parties like AWS, etc. So when something is not working, maybe you are in a wrong dimension or Microsoft wants you to update the binary you are using.

Azure Subscription AAD Module v1 (MSOnline)
– General Availability version
– Public Preview version
AzureAD v2
– General Availability version
– Public Preview version
Pre-requisites:
– Install lastest Azure Tools using Web Platform Installer
> Add-AzureAccount
> Get-AzurePublishSettingsFile
image
> Import-AzurePublishSettingsFile
> Select-AzureSubscription
Pre-requisites:
MS Online Services Sign-in Assistant
Windows AAD Module for Windows PowerShell
Pre-requisites:
PowerShellGet
image
Step 1: Install Azure PowerShell
Install-Module AzureRM
Download and install Azure AD Connect (.msi)
Update AAD Module > 1.0.8070.2
Download from PS Gallery
Install AAD Module
Update AAD Module
Step 2: Connect to an Azure account
Login-AzureRmAccount
Connect to Azure AD

$Msolcred = Get-credential
Connect-MsolService -Credential $MsolCred

Connect to AAD

$AzureAdCred = Get-Credential
Connect-AzureAD -Credential $AzureAdCred

Step 3: Run Azure PowerShell cmdlets

v1 cmdlets are here v2 are here
More information: PowerShell Gallery Office 365 PowerShell

One more thing: remember to check the update time of anything posted online, those older than 3 months might be useless.

How to enable telnet client using PowerShell

Telnet is a quite useful connecitivity verification tool, especially during the system set up or troubleshooting. For some reason, mostly security concern, this feature is disabled since Windows Server 2008. But when you want a quick check, it’s really a pain to open the Server Manager and click, click, click… Fortunately we have PowerShell. So here is the one-line command to turn it on:

Add-WindowsFeature telnet-client

And another command to turn it off, before you log-off:

Remove-WindowsFeature telnet-client

Very cool!

Windows 2012 R2 Preview Web Application Proxy – Exchange 2013 Publishing Tests

Need a close look, either continue to use MS technology, or switch to others after Forefront phase out.

Kloud Blog

==================
Updated: 10 September 2013

==================
Updated: 15 July 2013

  • I have heard from a member of the Web Application Proxy product group who said there is a bug in the Preview version that prevents Outlook Anywhere from working. They say it will be fixed in the RTM version
  • Lync 2013 and  Office Web Apps 2013 have been tested and work with some configuration changes. See http://blog.kloud.com.au/2013/07/15/publish-lync-2013-with-2012-r2-preview-web-application-proxy/ 
  • ActiveSync does not support SNI so a default binding needs to be set on the Web Application Proxy as per the post above to make it work
  • Clarification about ADFS being a hard requirement for the Web Application Proxy, even if only doing pass-through
  • Clarification about modifying published applications
  • Clarification about case sensitivity

==================

View original post 2,382 more words

Use Netstat to check if a port is listening

I should have put this handy long time ago.  There is situation that we need to know if a special port on a server is listening, then we can see if need to open firewall, etc.  So the command netstat is our friend.

Simple way to use netstat is:

>netstat –ano | more

It will show all the listening ports in numerical form, and the process ID that is listening.

Another way is use find:

>netstat –an | find “:3389”
TCP    0.0.0.0:1367           0.0.0.0:0              LISTENING

I will add some Linux command later.

Error “The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license” !!

This workaround using the PowerShell, seems fancier than the dozens of click I just did.

One of our clients had recently configured Remote Desktop Services on a Windows Server 2012 R2 OS. Since it was a small infrastructure, all the remote desktop roles were installed on the single ser…

Source: Error “The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license” !!

10 things you should know about BLOB externalization in SharePoint

Source: JOPX on SharePoint, Windows Phone and Windows 8

  • Every file which is stored in SharePoint is stored in the SQL Server database as a Binary Large Object (BLOB). SQL database storage needs high IOPS (input/output operations per second) and low latency. This combination means that this is typically expensive storage.
  • Around 95% of many SharePoint databases is BLOB data
  • It is however possible to take these BLOBS out of the SQL database and store them somewhere else – this is something called blob externalization.
  • There are two APIs available in SharePoint for blob externalization – commonly referred to as EBS and RBS
  • SharePoint External BLOB Storage ( EBS) – an API which was specifically written for SharePoint Server 2007 and which was shipped with Service Pack 1 of SharePoint Server 2007. EBS is supported by both SharePoint Server 2007 and SharePoint Server 2010. Do note that EBS is being deprecated and is likely to be removed from the next version of SharePoint Server. There can only be one EBS provider per SharePoint farm.
  • SQL Remote Blob Storage (RBS) is an API which came available with SQL 2008 R2 Feature pack. It is not unique to SharePoint but is available to any application. You can build your own RBS provider library (and most third party storage optimization tools have done this) and Microsoft also did this by building a provider named the FILESTREAM provider  which can externalize Blobs to local storage.
  • The SQL FILESTREAM feature can only use local storages. Therefore RBS FILESTREAM Provider has the same limitation. 3rd party RBS Providers do not have this limitation if they are not leveraging SQL FILESTREAM feature. (See FAQ: SharePoint 2010 Remote BLOB Storage (RBS)
  • Externalizing BLOBs from SharePoint will not only save you money by moving into tiered storage but will also increase the performance of SharePoint. In a typical real-world collaborative environment Microsoft reports a 25 percent performance increase with BLOB externalization. Check out this white paper for more details – SQL Server RBS performance with SharePoint Server 2010 and StorSimple Storage Solutions .
  • Performance improvements increase as the size of files increases. Microsoft research indicates that if files are smaller then 256 KB – SQL storage will out perform, above 1 MB the file system will provide better performance. Check out Plan for RBS (SharePoint Foundation 2010) for more details
  • Also remember that when you externalize BLOBs, you  architecture might become more complex. After you externalize BLOBs, you must consider the BLOB store in plans for backup, restore, high  availability, and disaster recovery. Here, the story can be complex, but doesn’t have to be.

Reference links:

 

source: http://blogs.realdolmen.com/experts/2012/07/26/10-things-you-should-know-about-blob-externalization-in-sharepoint/