Add a Contact


For more information on using this script, see the article Adminstratively Managing User Contact Lists by Nick Smith.

 

#Contributed by Nick Smith, Microsoft

#Supported Versions: Office Communications Server 2007 R2

#Get User Information

$User = Get-WmiObject -Query "Select * from MSFT_SIPESUserSetting where PrimaryURI = 'sip:user@domain.com'"

$UserInstanceID = $User.InstanceID 

 

#Create Contact instance

$Contact = (New-Object System.Management.ManagementClass("MSFT_SIPESUserContactData")).CreateInstance()

$Contact.UserInstanceID = $User.InstanceID

$Contact.SIPURI = "sip:userToBeAdded@domain.com"

$Contact.Subscribed = $True

 

#These next steps are optional unless you want to assign a contact to a contact group

$ContactGroup = (Get-WmiObject -Query "Select * from MSFT_SIPESUserContactGroupData where UserInstanceID = '$UserInstanceID'" | Where {$_.Name -like "NAME OF GROUP HERE"})

$Contact.GroupID = $ContactGroup.GroupID

 

#Create and commit contact

$Contact.Put()

Comments (4)
  1. Daya says:

    Hello,

    I just found a new bug with the MS Communicator version 2007 R2. When i add a contact to my list then that alert/message is not displaying in other end if the OS version differs each other. And alert will be displayed immediately after next time login.

    It has really disappointed me 🙁   – to some extent

    One thought: I feel live object remains the same regardless of the OS version. I hope inter OS will not be a issue if you are raising the alert through Events and Delegate mechanism so i think there might be some issue before raising the event in this case.

    This fix will really help many users since by that time only they can come to know whether recipient accepted or rejected the request.

    Thanks Shradha, for making MS to know their issue without your knowledge. (if it is not a open issue).

    Regards

    Dayananda Swamy V.T

  2. Anonymous says:

    Add a Contact – NextHop – Site Home – TechNet Blogs

  3. Anonymous says:

    Add a Contact – NextHop – Site Home – TechNet Blogs

  4. Anonymous says:

    Add a Contact – NextHop – Site Home – TechNet Blogs

Comments are closed.

Skip to main content