script for moving LCS 2005 users to OCS 2007 enterprise pool RRS feed

  • Question

  • Does anybody have a script for moving users from LCS 2005 to OCS 2007?  I have several thousand users that I need to move and I would rather use a script than use the Microsoft Office Communications Server 2007 MMC.  Thanks for the help.

    Wednesday, April 2, 2008 9:02 PM

All replies

  • Did you try the scripts in the Resource kit?> Maybe you can use powershell to move users?

    -Joachim Farla


    Script same (create new user)


    Function new-OCSuser
    {Param([String]$URI=$(throw "You must specify a URI") ,
           [String]$UserDN=$(throw "You must specify a User DN"),
           [String]$HomeServerDN=$(throw "You must specify a HomeServerDN"))
     if ($URI.Substring(0,4).toupper() -ne 'SIP:') {$URI = "SIPEmbarrassedURI"}
     if ((get-ocsuserbyuri $URI) -eq $null)
         { $NewUser=  ( new-Object System.Management.ManagementClass("MSFT_SIPESUserSetting")).CreateInstance()
           $newUser.enabled = $true
           $newuser.PrimaryURI = $URI
           $newUser.UserDN = $UserDN
           $newUser.HomeServerDN = $HomeServerDN
           $newUser.put() | out-null
           $newUserObject=(get-ocsuserbyuri  $URI)
           if ($newuserObject -eq $null) {write-output "$URI : Creation failed"} else {$newuserobject}
     else {write-output "$URI already exists"}

    Thursday, April 3, 2008 7:39 PM

    I also would like to have some clarification as to how the move-users process is done.  I have been able to miror the move-users.wsf script in powershell with the line of code below, but the users contacts do not move over with them.  Any insight on this process is greatly appreciated. 



    Function Move-OCSUser
    {Param([String]$Identity=$(throw "You must enter a username to be moved"))
      $HSOCS = Get-WmiObject -class MSFT_SIPPoolSetting -Property PoolFQDN,PoolDN,MajorVersion,MinorVersion | ?{$_.MajorVersion -eq 3 -and $_.MinorVersion -eq 0}
      $HSLCS = Get-WmiObject -class MSFT_SIPPoolSetting -Property PoolFQDN,PoolDN,MajorVersion,MinorVersion | ?{$_.MajorVersion -eq 2 -and $_.MinorVersion -eq 1}
      $OCSPool = $HSOCS.PoolDN.ToString()
      $LCSPool = $HSLCS.PoolDN.ToString()
      $UA = Get-QADUser -Identity $Identity -IncludeAllProperties
      $UPHS = $UA."msRTCSIP-PrimaryHomeServer".ToString()
      $URI = $UA."msRTCSIP-PrimaryUserAddress".ToString()
      $UDN = $UA.DN.ToString()
     if ($URI.Substring(0,4).toupper() -ne 'SIP:')
       $URI = "SIPEmbarrassedURI"
     if ($UPHS -eq $OCSPool)
      Write-Output "User is already on OCS 2007"
      $User = Get-WmiObject -query "select * from 'MSFT_SIPESUserSetting' where PrimaryURI=$URI")
         $User.enabled = $true
              #Write-Output $newUser.enabled
            $User.EnabledForEnhancedPresence = $true
              #Write-Output $NewUser.EnabledForEnhancedPresence
            $user.PrimaryURI = $URI
              #Write-Output $newuser.PrimaryURI
            $User.UserDN = $UDN
              #Write-Output $newuser.PrimaryURI
            $User.HomeServerDN = $OCSPool
              #Write-Output $newUser.HomeServerDN
            $User.put() | Out-Null
            Write-Output "$UA.mail is now enabled for OCS"


    -Michael Alexander

    Sunday, May 4, 2008 5:32 PM

  • There is something in the script which is forcing the users to move from LCS to OCS. This is when you loose contact.

    R. Kinker
    MCTS - LCS 2005, MSTS - OCS 2007
    Sunday, May 4, 2008 7:34 PM
  • If you want to script any additional configuration settings, this blog entry might help with understanding that: https://blogs.pointbridge.com/Blogs/schertz_jeff/Pages/Post.aspx?_ID=20


    Monday, May 5, 2008 8:45 PM

    You can move multiple users at a time with the MMC. However it can be scripted in powershell as well
    Monday, May 5, 2008 10:33 PM
  • Does anyone have a Powershell script that will move the user account with similiar results from the moveusers.wsf script which is provided in the reskit?  I do not see where the actual contacts are being moved from one object to the other, nor a method within the API.  Any assistance would be greatly appreciated.



    Tuesday, May 6, 2008 2:09 PM