Home

Get all AD users in an OU

Posted on August 19, 2014
Category: Windows Server
This scripts lists all AD users in an OU [code language=”powershell”] Get-ADUser -searchbase “OU=UK,DC=domain,DC=local” -Filter * -ResultSetSize 20000 | FT Name,SamAccountName [/code] byRead More

Get SIP users in Specific OU

Posted on August 19, 2014
Category: Lync
The following script will search for users in and OU and list SIP information: [code language=”powershell”] Get-CSUser -OU “OU=UK,DC=domain,DC=local” | FT SamAccountName,SipAddress [/code] byRead More

Create Mail Contacts from CSV File

Posted on August 15, 2014
Category: Exchange
This script will create Exchange Mail Contacts from a list in a CSV File [code language=”powershell”] Import-Module ActiveDirectory Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin Import-CSV C:\ContactList.csv | ForEach-Object{ New-MailContact -Name $_.Name -ExternalEmailAddress $_.Email -OrganizationalUnit $_.OUpath } [/code] byRead More

Move OCS Users in an OU to Lync 2010

Posted on August 15, 2014
Category: Lync
I used this script to migrate OCS 2007 R2 users to Lync 2010. On the contract I was working we had 6000 users to migrate across EMEA. Users were split into OUs for their Country, so we did this each night country by country. [code language=”powershell”] Import-Module Lync Get-CSUser -OU “OU=UK,DC=domain,DC=local” | %{ $User = $_ Try { Move-CsLegacyUser -Target “lync-pool-name” -EA STOP } Catch{ Echo $User $_.exception.Message } } | Out-File C:\Lynclog.txt [/code] byRead More

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