Lync DHCP options

I’ve had to do this just often enough that every time I do it I have to google how. Hence this post!

In this case I needed to add the Lync DHCP options to a new 2012 R2 DHCP server from a new Lync 2013 server. I had just enough problems with it that I thought others could benefit from the experience.

So, to do this:

  1. Copy dhcputil.exe and dhcpconfigscript.bat from c:\program files\common files\Microsft Lync Server 2013 (or 2010)\ to c:\windows\system32 on your DHCP server
  2. While you’re here go ahead and copy msvcr110.dll and msvcp110.dll to c:\windows\system32 on  your DHCP server. I found no instructions online that said to do this, but I couldn’t get it to run otherwise.
  3. Install the VC++ x64 2008 redistributable on  your DHCP server. Can be found here VC2008 or on your Lync media
  4. Go to a command prompt and run: dhcputil.exe -sipserver <sip FQDN> – webserver <web server FQDN>
  5. Make sure this command is successful. NOTE that you have not yet actually done anything. To configure DHCP run it with the switch -runconfiscript
  6. Full command with example: dhcputil.exe -siperserver lyncfepool.web.com -webserver webint.web.com -runconfigscript
  7. If you now go over to DHCP and hit refresh on your options you’ll get an error. You’re not done
  8. Restart the DHCP server service.
  9. NOW hit refresh.
  10. There you go!
Advertisements

Active Directory Migrations: Assorted Lync Stuff

Wow, so it’s been a whole 3 months since I’ve posted. Can you tell I got deep into actually doing migrations rather than talking about it? It took a little longer than I’d hoped – mainly due to scheduling – but we managed to finish the migrations. I personally migrated a little over 2,000 people. Due to our migration windows I never did more than 150 people at a time, but I was surely itching to.

These next couple of scripts are Lync related. Not too much involved in them, mainly creating the remote session and then running a quick command. Note that we installed the Lync module on our ADMT server, but for some reason some of the commands don’t work natively so we had to do some thru remote pssessions and some thru the module


##call include file.
## this is just in case we forgot to call it before
. .\params.ps1

##Create Sessions
##The usual pssession, just pointing to the Lync server in the source domain and using our source credentials
$LyncSessionSource=New-PSSession -connectionuri $LyncURISource -credential $RemoteCredentials

## Import our include file
$import=import-csv $importfile

##Source side disable-csuser
##Import the session, and then for each item in the include file, disable them for Lync in the source domain.
##Lync uses display name so we have to make sure that's in our include file
import-pssession $LyncSessionSource
foreach ($item in $import){
 write-host "Disabling Lync for " $item.olddisplayname -foregroundcolor yellow
 disable-csuser -identity $item.olddisplayname
}

## Let's clean up our session
remove-pssession $LyncSessionSource

Our next script is basically the same, but opposite. Let’s enable them for Lync in the target domain


##call include file
. .\params.ps1

##Create Sessions
$LyncSession=New-PSSession -connectionuri $LyncURI -credential $LocalCredentials

##Import
$import=import-csv $importfile

##Target side enable cs-user
##Import the session, then go thru the input file
##Since we changed the displayname of users as part of the process we had to account for that in the include file
## The rest of the commands are Lync specific. When you enable you have to specify registrar pool and address type
import-pssession $LyncSession

foreach ($item in $import){
 if ($item.smtp){
 enable-csuser -identity $item.displayname -registrarpool $registrarpool -sipaddresstype EmailAddress
 write-host "Enabling Lync for: " $item.displayname -foregroundcolor yellow
 }
}

##Let's clean up after ourselves
remove-pssession $LyncSession

This one is basically the same as the previous, but we have to set options for the users that can’t be set in the enable command. We’re setting the LineURI (i.e. telephone number) and turning on Enterprise Voice.


##call include file
. .\params.ps1

##Create Sessions
$LyncSession=New-PSSession -connectionuri $LyncURI -credential $LocalCredentials
$import=import-csv $importfile

##Target side enable cs-user
import-pssession $LyncSession

foreach ($item in $import){
 if ($item.LineURI){
 set-csuser -identity $item.displayname -EnterpriseVoiceEnabled $true -LineURI $item.LineURI
 write-host "Setting EV and LineURI for: " $item.displayname -foregroundcolor yellow
 }
}
## let's clean up, shall we?
remove-pssession $LyncSession

This last one grants the voice policy and the mobility policy, if applicable. This is using the Lync powershell modules on the ADMT server


$Importfile="\\omacsgiadmt01\d$\Migration\admtincludes\UserIncludes.csv"
$import=import-csv $importfile

import-module Lync

foreach ($item in $import){
 grant-csvoicepolicy -identity $item.displayname -policyname $item.CSVoicePolicy
 write-host "Granting CSVoice: " $item.displayname -foregroundcolor yellow
 $LM=$item.LyncMobility.ToUpper()
 if ($LM -eq "YES"){
 Grant-CsMobilityPolicy -identity $item.DisplayName -Policyname "CSGI Mobility"
 write-host "Granting CSMobility: " $item.displayname -foregroundcolor yellow
 }
}

That’s it for Lync!