locked
copy msRTCSIP-PrimaryUserAddress RRS feed

  • Question

  • Hello

    I need to copy the (sip) msRTCSIP-PrimaryUserAddress to the proxyaddress (mail) field in a particular OU.

    thank you

    Eva

    Monday, October 15, 2012 9:05 PM

Answers

  • You may use without ActiveDirectory module.

    $ou = "LDAP://OU=Users,DC=Contoso,DC=Com"
    $filter = "(msRTCSIP-PrimaryUserAddress=*)"
    $searcher = New-Object adsisearcher([adsi]$ou , $filter)
    
    $searcher.FindAll() | Foreach {
    	$user = $_.GetDirectoryEntry()
    	$user.mail = $user."msRTCSIP-PrimaryUserAddress"
    	$user.SetInfo()
    }

    • Marked as answer by Yan Li_ Thursday, October 18, 2012 2:28 AM
    Tuesday, October 16, 2012 8:34 PM
  • Try add a correct server:

    $ou = "LDAP://ADServerFQDN/OU=Users,DC=Contoso,DC=Com"

    • Marked as answer by totalnet32 Wednesday, October 17, 2012 5:15 PM
    Wednesday, October 17, 2012 4:32 PM

All replies

  • Get-ADUser -Filter {msRTCSIP-PrimaryUserAddress -like "*"} -SearchBase "OU=Users,DC=contoso,DC=com" -Prop msRTCSIP-PrimaryUserAddress | Foreach { $sip = $_."msRTCSIP-PrimaryUserAddress" Set-ADUser $_ -EmailAddress $sip

    }




    • Edited by Kazun Tuesday, October 16, 2012 4:45 AM
    Tuesday, October 16, 2012 4:44 AM
  • The term 'get-aduser' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
    spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:11
    Tuesday, October 16, 2012 2:09 PM
  • What Exchange version are you running?

    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    Tuesday, October 16, 2012 2:26 PM
  • The term 'get-aduser' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
    spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:11

    On a Dc  where installed module ActiveDirectory run this script after the import module.

    Import-Module ActiveDirectory

    Tuesday, October 16, 2012 4:29 PM
  • exchange 2007 rollout 6

    Tuesday, October 16, 2012 8:11 PM
  • You may use without ActiveDirectory module.

    $ou = "LDAP://OU=Users,DC=Contoso,DC=Com"
    $filter = "(msRTCSIP-PrimaryUserAddress=*)"
    $searcher = New-Object adsisearcher([adsi]$ou , $filter)
    
    $searcher.FindAll() | Foreach {
    	$user = $_.GetDirectoryEntry()
    	$user.mail = $user."msRTCSIP-PrimaryUserAddress"
    	$user.SetInfo()
    }

    • Marked as answer by Yan Li_ Thursday, October 18, 2012 2:28 AM
    Tuesday, October 16, 2012 8:34 PM
  • windows 2003
    Tuesday, October 16, 2012 9:08 PM
  • Exception calling "FindAll" with "0" argument(s): "A referral was returned from
     the server.
    "
    At C:\Documents and Settings\administrator.LAB\desktop\sipann.ps1:5 char:18
    + $searcher.FindAll <<<< () | Foreach {
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException
    Wednesday, October 17, 2012 4:18 PM
  • Try add a correct server:

    $ou = "LDAP://ADServerFQDN/OU=Users,DC=Contoso,DC=Com"

    • Marked as answer by totalnet32 Wednesday, October 17, 2012 5:15 PM
    Wednesday, October 17, 2012 4:32 PM