Home

This script will add a list of users in a┬átext file to Distribution group and output the results to a log file. [code language=”powershell”] Import-Module ActiveDirectory ## Use AD Snapin Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin ## Use Exchange 2007 Snapin $AdminSessionADSettings.ViewEntireForest = $true ##Search Entire Forest Get-Content ‘C:\Userlist.txt’ | %{ $User = $_ Try { Add-DistributionGroupMember ‘GroupName’ -Member $User -EA STOP } Catch{ Echo $User $_.exception.Message } } | Out-File C:\scriptlog.txt byRead More

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