Solved

Script help to modify AD Attribute msRTCSIP-PrimaryUserAddress’

Posted on 2013-01-16
10
5,095 Views
1 Endorsement
Last Modified: 2013-01-18
I'm looking for a way to modify the sip domain for several hundred users
AD Attribute = msRTCSIP-PrimaryUserAddress

I have 2 test accounts ready to test against.
Test.LCS01
Test.LCS02

Does anyone have a script that I can edit?
I would like to target all the members of one group (this is how I did the bulk enabling for LCS; pulls user's primary SMTP and these user's don't have the standard company primary SMTP.)
Group Name:
CN=Bulk LCS Enabling

Thanks
1
Comment
Question by:Admin_Stooge
  • 5
  • 4
10 Comments
 
LVL 40

Expert Comment

by:Subsun
ID: 38785029
Do you mind a PowerShell solution with Quest AD cmdlets? If yes. Do you want the SIP address as same as the primary SMTP address of user?
0
 
LVL 8

Expert Comment

by:piyushranusri
ID: 38786052
see this query
1. $sipimport = Import-Csv x:\Exchange\sip_addresses_for_contacts.csv
ForEach ($Contact in $sipimport)
{
 set-QADObject -identity $contact.Alias_Name -ObjectAttribute @{"msRTCSIP-PrimaryUserAddress"=$contact.sip}
}
Th


2. http://www.powershellcommunity.org/Forums/tabid/54/aft/6913/Default.aspxGP and apply it.


please share the output
0
 

Author Comment

by:Admin_Stooge
ID: 38787298
@piyushranusri

The Link you posted is bad
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38787337
@Admin_Stooge, IF you are OK with PowerShell script can you answer my question?
Do you want the SIP address as same as the primary SMTP address of user?
0
 

Author Comment

by:Admin_Stooge
ID: 38787364
The primary address for these users are different than normal users.

our standard sip company should be @company.com
These users have their primary smtp as @companyA.com @ companyB.com so their SIP was stamped as @companyA.com or @companyB.com
We need to change their SIP to @company.com
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 40

Expert Comment

by:Subsun
ID: 38787420
So do you have a list of this users and their SP address?  for example.. a .CSV in following format..
Name,Sip
User1,User1@companyB.com
User2,User2@companyA.com

Open in new window


or is it OK If we set it to users sAMAccountName@company.com

I am asking this because, we need to provide some logic to script to get/generate the sip address for the user.
0
 

Author Comment

by:Admin_Stooge
ID: 38787585
I have attached the file I have for the users that need to be changed.
Their new SIP domain needs to be @thermofisher.com
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 38792474
I presume users are already enabled for Lync and you just want to change the sip address.
For example If user subsun have a sip address of SIP:subsun@companyB.com and the script will change the sip address to SIP:subsun@thermofisher.com

GC C:\userlist.txt | % {
$user = get-qaduser $_ -includedproperties "msRTCSIP-PrimaryUserAddress" | 
 Select sAMAccountName,msRTCSIP-PrimaryUserAddress -ErrorAction SilentlyContinue
	If ($user){
	$NewSip = ($user."msRTCSIP-PrimaryUserAddress" -split "@" )[0] + "@thermofisher.com"
	 get-qaduser $user.sAMAccountName -includedproperties "msRTCSIP-PrimaryUserAddress" | 
	  set-qaduser -oa @{"msRTCSIP-PrimaryUserAddress" = $NewSip}
	}
	Else {
	Write-Host "Not able to find User $($_) in Activedirectory"
	}
}

Open in new window

Input file format.
Subsun
Admin
Stooge
HTom

Open in new window

0
 

Author Comment

by:Admin_Stooge
ID: 38792928
Thanks and last question (dumb one) but how do I run this script?
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38792948
You can install Quest AD cmdlets on any computer which is connected to your domain, and run the script from ActiveRoles Management Shell for Active Directory console..
Quest AD cmdlets : http://www.quest.com/powershell/activeroles-server.aspx

Ref : Running Windows PowerShell Scripts
http://technet.microsoft.com/en-us/library/ee176949.aspx
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now