Get ActiveSync Details for users in an OU

Posted on August 15, 2014
Category: Exchange
The below script will show ActiveSync details for users in an OU, this script also only reports devices that have synced after a specified date. [code language=”powershell”] Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin Get-Mailbox -ResultSize:Unlimited -OrganizationalUnit domain.local/OU | ? {$_.Organizationalunit -eq “domain.local/OU “} | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | Where {$_.LastSuccessSync -gt ’01/01/2014′} | ft -AutoSize Identity,DeviceType,DeviceID,DeviceModel,LastSuccessSync [/code] byRead More

Get Users AD Account from EMail Address

Posted on August 14, 2014
Category: Exchange
This script will take a list of email address and return the users AD info, I have enabled View Entire Forest, in case your are in a multi domain environment. [code language=”powershell”] Import-Module ActiveDirectory Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin $AdminSessionADSettings.ViewEntireForest = $true Get-Content C:\EmailList.txt | Get-Mailbox | FT SamAccountName,Alias,PrimarySMTP [/code] byRead More

List all Sites and Subnets in AD

Posted on August 14, 2014
Category: Windows Server
This script will export a list of all Site and Subnets and the domain controllers in them. [code language=”powershell”] [cmdletbinding()] param() $Sites = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().Sites $obj = @() foreach ($Site in $Sites) { $obj += New-Object -Type PSObject -Property ( @{ “SiteName” = $site.Name “SubNets” = $site.Subnets -Join “;” “Servers” = $Site.Servers -Join “;” } ) } $obj | Export-Csv ‘C:\sites.csv’ -NoType [/code] byRead More
When migrating users to O365, you may need to set a group of users or specific users Item Retention and Deleted Item retention policies. If you have a list of users who need specific settings you can run the following command against the list to only apply the desired settings to those users. You will need to connect to O365 to run these scripts for O365 Users. ### This script will list all users in a csv file who haveRead More
When you are migrating users to O365 there may be a requirement to run post migration scripts, for setting the users location, and enabling licenses. You may be performing the migrations using a csv, and users may be in different locations, so you cannot just run the commands against the entire organisation. The csv contains a list of User UPNs. ### First we must find out our License SKU to apply [code language=”powershell”] Connect-MsolService Get-MsolAccountSku [/code] ### Set a usersRead More