How to check the activation type and status of Office

  1. Open an administrative level command prompt.
    1. Navigate to the Office14 folder:
    2. 32bit Office on 64bit OS – “cd \Program Files (x86)\Microsoft Office\Office14”
  • 32bit Office on 32bit OS and 64bit Office on 64bit OS – “cd \Program Files\Microsoft Office\Office14”
  1. Execute “cscript ospp.vbs /dstatus”
  2. Look at “LICENSE NAME” for license type and “LICENSE STATUS” for activation status



Export AD email information

Used for pre-staging users to migrate to another forest

Get-ADUser -Filter * -Properties * | Select-Object samaccountname,displayname,givenname,sn,mail,@{L=”proxyaddresses”;E={$_.proxyaddresses -join “;”}} | Export-Csv c:\temp\users.csv -NoTypeInformation

Embedding o365 credentials into PowerShell

Sometimes it is necessary to schedule scripts with credentials for services such as Office 365 that require authentication.  These passwords can be stored securely rather than in plain text

read-host -assecurestring | convertfrom-securestring | out-file C:\temp\creds.txt

As an example for usage

$pass = get-content C:\temp\creds.txt | convertto-securestring
$creds = new-object -typename System.Management.Automation.PSCredential -argumentlist “”,$pass
Connect-MsolService -credential $creds

however this is not using strong encryption and there are readily available ways of reversing the stored password just stops the plain text access 

Script to find out availability

Useful PowerShell script found here

# Syntax:	Get-TenantStatus.ps1 -name "microsoft"
# Determines if the tenant name requested is available or already taken within Office 365.
# Provide a desired tenant name without the suffix to check if that tenant name is available.

param( $name )

Function Usage
$strScriptFileName = ($MyInvocation.ScriptName).substring(($MyInvocation.ScriptName).lastindexofany("\") + 1).ToString()



C:\PS> .\$strScriptFileName -name `"microsoft`"


If (-not $name) {Usage;Exit}

$uri = ""
$body = "p0=" + $name + "&assembly=BOX.Admin.UI%2C+Version%3D16.0.0.0%2C+Culture%3Dneutral%2C+PublicKeyToken%3Dnull&class=Microsoft.Online.BOX.Signup.UI.SignupServerCalls"

$response = Invoke-RestMethod -Method Post -Uri $uri -Body $body

$valid = $response.Contains("SessionValid")
if ($valid -eq $false)
	Write-Host -ForegroundColor Red $response

$available = $response.Contains("<![CDATA[1]]>")
if ($available) {
	Write-Host -ForegroundColor Green "Available"
} else {
	Write-Host -ForegroundColor Yellow "Taken"