Solved

Script help to modify AD Attribute msRTCSIP-PrimaryUserAddress’

Posted on 2013-01-16
10
4,996 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
 
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

Join & Write a Comment

[b]Ok so now I will show you how to add a user name to the description at login. [/b] First connect to your DC (Domain Controller / Active Directory Server) SET PERMISSIONS FOR SCRIPT TO UPDATE COMPUTER DESCRIPTION TO USERNAME 1. Open Active …
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
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)
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 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

22 Experts available now in Live!

Get 1:1 Help Now