header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Enable OCS Users that are Members of a group
Last Post 12 Mar 2010 11:18 AM by cameronove. 3 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
rajacksonUser is Offline
New Member
New Member
Posts:2
Avatar

--
10 Mar 2010 06:26 PM
    I've been working with some powershell scripts and am able to set the OCS properties on users accounts but can't figure out how to write a query to search on those properties.

    I'd like to create a group in AD and then search for users in that group where msRTCSIP-UserEnabled=False. If it's false I'd like to set the SIP address as their email address and the primary host server.

    The where statement does not work and I don't know where else to turn. Anyone done anything like this before?
    cameronoveUser is Offline
    Basic Member
    Basic Member
    Posts:332
    Avatar

    --
    12 Mar 2010 10:33 AM
    Use Quest's Get-QADGroupMember to query the users in a group:


    Get-QADGroupMember 'Domain Users' -SearchAttributes @{'msRTCSIP-UserEnabled'=$false} -Credential $admincreds -IncludedProperties msRTCSIP-UserEnabled | select name,msRTCSIP-UserEnabled
    cameronoveUser is Offline
    Basic Member
    Basic Member
    Posts:332
    Avatar

    --
    12 Mar 2010 11:10 AM
    Ok so after reading more carefully what you are trying to do here is a script that should set the sip address.  You may also need to set other info like FederationEnabled, OptionFlags, PrimaryHomeServer, InternetAccessEnabled, etc... Not sure in your environment what populates automagically.  Your request was to set the SIP address so here it is:
    Get-QADGroupMember 'Domain Users' `
    -SearchAttributes @{'msRTCSIP-UserEnabled'=$true} `
    -type 'User' `
    -Credential $admincreds `
    -IncludedProperties msRTCSIP-UserEnabled,mail,msRTCSIP-PrimaryUserAddress,msRTCSIP-PrimaryHomeServer | %{
    $primehost = "PrimaryHost"
    $tempsip = $_.mail.split('@')
    $sip = "sip:$($tempsip[0])@$primehost.$($tempsip[1])"
    Set-QADUser -Identity $_.distinguishedName -Credential $admincreds -ObjectAttributes @{'msRTCSIP-PrimaryUserAddress' = $sip}
    }
    I didn't actually try setting anything in my environment so the last line is my 'guessing' what should happen; you may need to tweak it.
    cameronoveUser is Offline
    Basic Member
    Basic Member
    Posts:332
    Avatar

    --
    12 Mar 2010 11:18 AM
    I'm also not sure what you want your SIP to be. I'm 'guessing' if an email address looked like this in your environment:

    firstname.lastname@domain.com

    Then you would want

    firstname.lastname@primaryhost.domain.com

    With email addresses in that format the above script will set the sip address to

    sip:firstname.lastname@primaryhost.domain.com

    if you email addesses are first initial last name @ domain then it will set the sip like this

    sip:jsmith@primaryhost.domain.com

    The script splits the email address on the @ character and then concatenates the sip like this

    'sip:' + emailprefix + '@' + 'primaryhost.' + emailsuffix

    That is long form for what this does:

    "sip:$($tempsip[0])@$primehost.$($tempsip[1])"


    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer