Thursday, December 24, 2015

Add Active Sync Enabled Users to Lync ClientVersionPolicy "Admin Users"



add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
Import-Module 'C:\Program Files\Common Files\Microsoft Lync Server 2010\Modules\Lync\Lync.psd1'
Start-Transcript -Path .\abtrans.txt
Get-CASMailbox -ResultSize Unlimited | where { $_.ActiveSyncEnabled -eq 'True'} | Select SamAccountName | Export-Csv .\ablync.csv -NoTypeInformation
$b = Get-Content .\ablync.csv
Foreach ($i in $b)
{
Grant-CsClientVersionPolicy -Identity $i -PolicyName "Admin Users"
}
Stop-Transcript

Wednesday, December 23, 2015

Push Notifications for Lync 2013 Mobility

Push Notifications for Lync 2013 Mobility

Lync 2013 on Windows Phone suscribes for push notifications
Desktop client or federated client initiates communication to Windows Phone user
Lync 2013 Front-End pool connects to Edge server configured for federation (defined in topology in site configuration)
Lync 2013 Edge Server connects to push notification service push.lync.com using hosted provider sipfed.online.lync.com

Push notification service delivers the notification to Lync 2013 mobile client on Windows Phone


Tuesday, December 15, 2015

Finding AD Disabled Accounts Who are Still Lync Enabled

Finding AD Disabled Accounts Who are Still Lync Enabled

Get-CsAdUser -ResultSize Unlimited | Where-Object {$_.UserAccountControl -match "AccountDisabled" -and $_.Enabled -eq $true} | Format-TableName,Enabled,SipAddress -auto


Get-CsAdUser -Filter {UserAccountControl -eq “AccountDisabled, NormalAccount” -and Enabled -eq $true} | Set-CsUser -Enabled $false

Tuesday, December 8, 2015

How to send mail to multiple user using powershell Script

How to send mail to multiple user using powershell Script 


For a project requirement I had to send mails to multiple users whose mailboxes had been moved to another database and whose mailbox Quota had been increased . I wrote a small Script for the same.

For the same, We need to populate a text files with users email id and run a bat file . Below is the code for the same . Save the below script in "sendmail.ps1" and create a bat file 
with below line "powershell.exe .\sendmail.ps1" . Double click the bat file and mails will be sent to users 

Add-PSSnapIn Microsoft.Exchange.Management.PowerShell.E2010
$to1 = Get-Content .\abhishek.txt
$body += "Hello, `n `n"
$body += "Messaging team is pleased to report that your mailbox storage has been increased to 2 GB`n `n"
$body += "Thank you, `n "
$body += "Messaging Support Team"
foreach ($to2 in $to1)
{
Send-MailMessage -to $to2 -subject "Mailbox Storage has been increased" -Body $body -from abhishek.gupta3@mylab.com -smtpserver mapmail.mylab.com
}


Friday, December 4, 2015

Powershell Command to check Mailbox Database count, size and freemailboxspace

Add-PSSnapIn Microsoft.Exchange.Management.PowerShell.E2010
$z = @()
$x = Get-MailboxDatabase | Where {$_.MasterType -eq "DatabaseAvailabilityGroup"}
ForEach ($d in $x)
{
$c = Get-mailbox -Database $d -ResultSize unlimited
$s = Get-MailboxDatabase $d -Status
$object = New-Object -TypeName PSObject
$object | Add-Member NoteProperty –Name Database –Value $d.Name
$object | Add-Member NoteProperty –Name Count –Value $c.count
$object | Add-Member NoteProperty –Name DatabaseSize –Value $s.DatabaseSize
$object | Add-Member NoteProperty –Name AvailableNewMailboxSpace –Value $s.AvailableNewMailboxSpace
#$object | Add-Member NoteProperty –Name Server –Value $d.Server
$z += $object
}
$z




Iron Port Blog to refer

Tuesday, December 1, 2015

Step-by-Step instructions for uninstalling a Microsoft Lync Server 2010 Enterprise Pool

Step-by-Step instructions for uninstalling a Microsoft Lync Server 2010 Enterprise Pool


Move-CsUser : The required name is valid,but no data of the requested type was found

Move-CsUser : The required name is valid,but no data of the requested type was found




rednote2
We found that Target pool hostname was not getting resolved from the source pool. We had to add a host entry to its host file