How to enable lync rcc users from Excel
I collect data of the users that are gonna be enabled to a xlsx file.
The data should be
$SamAccountName
$mail #this will be the sip address
$telephoneNumber
$email: is just a copy of $mail. minus the domain. this is for creating the rcc connection
So i create the csv file to and run this script
Import-Module ActiveDirectory
Import-Module Lync
$objExcel = New-Object -ComObject Excel.Application
$objExcel.Visible = $True
$objWorkbook = $objExcel.Workbooks.Open("C:\Scripts\NewUsers.xlsx")
$row = 2
do
{
$SamAccountName = $objExcel.Cells.Item($row,1).Value()
$mail = $objExcel.Cells.Item($row,2).Value()
$telephoneNumber = $objExcel.Cells.Item($row,3).Value()
$email = $objExcel.Cells.Item($row,4).Value()
Enable-CsUser -Identity $SamAccountName -RegistrarPool "Your lync pool" -SipAddress "sip:$email" | Set-CsUser -RemoteCallControlTelephonyEnabled $true -LineServerURI "sip:$mail@Change this to the rcc fqdn" -LineURI "tel:$telephoneNumber;phone-context=dialstring"
$row++
}
until ($SamAccountName -eq $Null)
$objExcel.Quit()
$Null = & {
[Runtime.Interopservices.Marshal]::ReleaseComObject($objExcel)
[Runtime.Interopservices.Marshal]::ReleaseComObject($objWorkbook)
}
[GC]::Collect()
Thanks for the view
Niclas Strøm
Get-Csinfo
Tuesday, November 22, 2011
Monday, November 21, 2011
Find OCS 2007 R2 RGS number
Ran into a problem a while ago. but could not find a blog page about it.
My problem was that i made an rgs hunting group. that had a number.
It seemed to be all gone. no where it stands in the OCS gui.
But found it if you go to adsi edit. and connect to configuration.
There you will have CN=Application Contacts,CN=RTC Service,CN=Services,CN=Configuration,DC=yourdomain.
In the Application Contacts there will be contacts that are kinda strange.
But if check it's properties and check for msRTCSIP-Line you will find the number.
My problem was that i made an rgs hunting group. that had a number.
It seemed to be all gone. no where it stands in the OCS gui.
But found it if you go to adsi edit. and connect to configuration.
There you will have CN=Application Contacts,CN=RTC Service,CN=Services,CN=Configuration,DC=yourdomain.
In the Application Contacts there will be contacts that are kinda strange.
But if check it's properties and check for msRTCSIP-Line you will find the number.
Saturday, October 8, 2011
My first blogg
Hello World
My Name is Niclas Strøm. I work on lync and exchange installations over multiple platforms and integration.
I am going to blogg about some of my experiens. See you soon
Best regards Niclas
My Name is Niclas Strøm. I work on lync and exchange installations over multiple platforms and integration.
I am going to blogg about some of my experiens. See you soon
Best regards Niclas
Subscribe to:
Posts (Atom)