PowerShell check Office 365 Msol (Azure AD) and Exchange Online default domain

Hi Guys, As you know I juste had an issue with a client Office 365 tenant (Office 365 unsynced default between Msol and Excahnge Online). Here is wrapup function of the Cmdlets I wrote to check this situation: [ps]Function Get-MsolAndExODefaultDomain { $MsolDefaultDomain = (Get-MsolDomain | Where-Object { $_.IsDefault -eq $true }).Name $ExODefaultDomain = (Get-AcceptedDomain | […]

Office 365 unsynced Default domain between MSOL and Exchange Online

Hi Guys, During a cross tenant migration this week-end, we had a bug on Microsoft Office 365 backend. The issue blocked the SMTP domain striping from one tenant, this issue blocked the migration because you could not bind a domain that is already linked to an Office 365 tenant into another tenant. Little bit of […]

Transform a PowerShell Object with empty properties to an Hashtable with only properties that have value

Hi guys, Some time you may want to use PowerShell splating instead of PipeLine input. Splating, is the action to add some parameters to a cmdlet directly by giving the cmdlet a hashtable with properties and values. Here, as an example, the creation of an MsolUser using splating for my cat: Sometime, when you use […]

Use PowerShell to decrypt password stored in a RDG file

Hello, If, like a colleague, you forget frequently the passwords you stored in your RDG file. There is a way to decrypt the secured string using the RDCMan.exe file. First you need to copy the RDCMan.exe and change the extension to “dll” (“RDCMan.dll”). [ps]Copy-Item ‘C:\Program Files (x86)\Microsoft\Remote Desktop Connection Manager\RDCMan.exe’ ‘C:\temp\RDCMan.dll’ Import-Module ‘C:\temp\RDCMan.dll’ $EncryptionSettings = […]

How to get the Krbtgt last password set value using powershell

Hello, For a script purpose I needed to have the date of the last password set of the Krbtgt account. To do so I wrote this PowerShell function: [ps] Function Get-ADKrbtgtPwdLastSet{ [CmdletBinding()] Param( [Parameter(Mandatory=$false, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, HelpMessage=’Name of the domain.’, Position=0)] [ValidateScript({Test-Connection -ComputerName $_ -Count 2 -Quiet})] [String]$DomainName = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain().Name ) Begin{ } Process{ $RodcKrbtgtSearcher […]

Store PowerShell Credentials in a XML File

Hello, Here is the fastest and easiest way to store, “as secure as possible”, Credentials in a XML File. Get-Credential | Export-Clixml -Path “$Path\Credentials.xml” Alternativly, you can also use Read-Host to prompt for input. $UserName = Read-Host ‘Enter Username’ $Password = Read-Host ‘Enter Password’ -AsSecureString New-Object System.Management.Automation.PSCredential ($UserName, $Password) | Export-Clixml -Path “$Path\Credentials.xml” The stored […]