Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Auto populate contacts and automatically update

8 views
Skip to first unread message

Ray Breen

unread,
Nov 2, 2005, 11:07:07 AM11/2/05
to
Hi Guys,

We have recently rolled out live comms version 2005 and would like to make a
few comments that may save you a lot of time and effort that i have gone
through.

We have the requirement to automatically populate contacts for all users,
based upon ou membership and also for this to be updated on a regular basis.
To this end i have put together a few batch scripts that furfill this.

The utilise the various scripts available in lcs res kit.

Step 1 - extract user information from active directory

dsquery * "OU=test,OU=test2,DC=ms,DC=tst,DC=int" -attr
msRTCSIP-PrimaryUserAddress -scope onelevel -limit 10000 > contacts.txt

This will extract all sip addresses from user objects contained within the
ou and place them into the file contacts.txt. If you have sub ou's under this
one remove '-scope onelevel' from the commandline, as it will extract the
subtree.

Step 2 - Import contacts into users contacts list

lcsaddcontacts.wsf /usersfile:contacts.txt /contactsfile:contacts.txt
/contactsgroup:Test

This will import all the contacts extracted from the dsquery command into
the same list of users for all the same contacts. For example if contacts.txt
contains

sip:j...@test.ocm
sip:jo...@test.com

joe and joe2 will both see each other as contacts, as the format of the file
is compatible with the lcsaddcontacts script. The user is displayed by their
default ad user details.

Step 3 - Automatically authorise users to allow everyone to be able to
subscribe to them or see their status

lcsaddaces.wsf /usersfile:contacts.txt /acesfile:acesfile.txt

Acesfile.txt contains the following :

all allow allow

General

I have taken this to the next level as we have various business unitswhich
we pre-populate various groups and no business units sees all the groups
(besides i.t)

Hope this helps a few guys

u101440

unread,
Nov 8, 2005, 6:33:01 PM11/8/05
to
Ray

Thanx for adding this (it's really difficult following the scripts) but I'd
like to ask some silly questions if I may.

Step 1 should be run at the LCS server?

What about Steps 2 & 3? Adding contacts will have to be done a user level
yes? How did you accomplish this? Did you run the scripts via a login script?

Thanx for any advice.

Ray Breen

unread,
Nov 9, 2005, 2:30:10 AM11/9/05
to
> Ray
>
> Thanx for adding this (it's really difficult following the scripts) but I'd
> like to ask some silly questions if I may.

Not a problem, it took me a few days to get this all working and if i can
save someone else the hassle i might as well post :)


>
> Step 1 should be run at the LCS server?
>
> What about Steps 2 & 3?

All are to be run at the server mate, as they require some of the wmi
extensions that only exist on the same machine with lcs installed on,
although ive heard if you have the admin tools installed for lcs you can also
run them from that machine but i havent tried.

> yes? How did you accomplish this? Did you run the scripts via a login script?

As you may notice the second bunch of scripts require two files for input,
the first is a list users, and the second is the actual contacts. What
happens is that users in the second file(contacts parameter) are added to the
list of users contacts in the first file.

For example the following command

lcsaddcontacts.wsf /usersfile:users.txt /contactsfile:contacts.txt
/contactsgroup:Test

users.txt

joe.b...@blah.com

contacts.txt

bart.s...@blah.com
homer....@blah.com

What will now happen is that user joe.bloggs will have bart.simpson and
homer.simpson added to their group called test.

It took me a while to get my head around the way it works, but it is pretty
good, much better than using login scripts and running it every login. As you
can automate the whole process to run outside peak hours.

Any more questions give me a shout

u101440

unread,
Nov 9, 2005, 2:38:02 AM11/9/05
to
Thanx Ray. I tried using your original post to see what would happen and low
and behold it worked perfectly. Thanx for detailing how this should be done
in a more clear/concise manner than the actual script readme. It's useful to
see how each stage should be done and I would have liked the readme to have
included stages processes like you've laid out. Would make first time
installations so much easier.

Jacques

unread,
Nov 11, 2005, 4:12:21 PM11/11/05
to
Hi,
I've try all the steps that you show, I don't have any error messages but
when I lunch Office Communicator I don't see the contacts. What I am doing
wrong? I've lunch the script from the LCS Server and like I said with no
error message.
Thank you
Jacques

"Ray Breen" <RayB...@discussions.microsoft.com> a écrit dans le message de
news:E7F03ADD-942C-4E3C...@microsoft.com...
> Not a problem, glad its working for you


Ray Breen

unread,
Nov 11, 2005, 4:35:15 PM11/11/05
to
Have you checked the generated output from the dsquery command as i suspect
that you may have the format of the ou statement wrong.

Can you paste the contents of your file.

Jacques

unread,
Nov 14, 2005, 8:54:20 AM11/14/05
to
Hi Ray,
Here's the content of the file contacts.txt eith all the space included.
Thanks

msRTCSIP-PrimaryUserAddress


sip:Fchev...@nordiqlab1.net
sip:gfan...@nordiqlab1.net

sip:jde...@nordiqlab1.net

sip:Mase...@nordiqlab1.net


sip:mlabr...@nordiqlab1.net

sip:sboi...@nordiqlab1.net


sip:tes...@nordiqlab1.net


sip:tqu...@nordiqlab1.net


"Ray Breen" <RayB...@discussions.microsoft.com> a écrit dans le message de

news:E6BB1163-AE0E-4ADF...@microsoft.com...

Ray Breen

unread,
Nov 14, 2005, 9:05:03 AM11/14/05
to
Hi,

that looks fine,can you tell me the syntax of the commandline that you use
to run the import on

Jacques

unread,
Nov 14, 2005, 9:23:14 AM11/14/05
to
Hi,

Here's my query

dsquery * "OU=TGI,OU=ANJ,OU=Domain Users,DC=Nordiqlab1,DC=net" -attr
msRTCSIP-PrimaryUserAddress -scope onelevel -limit 10000 > c:\contacts.txt

"Ray Breen" <RayB...@discussions.microsoft.com> a écrit dans le message de

news:BFC3510E-6A6D-4CBB...@microsoft.com...

Ray Breen

unread,
Nov 14, 2005, 12:46:01 PM11/14/05
to
Ah, I meant the one for the contact update using lcsaddcontacts.wsf :)

Jacques

unread,
Nov 14, 2005, 12:59:31 PM11/14/05
to
Here's the command

lcsaddcontacts.wsf /usersfile:contacts.txt /contactsfile:contacts.txt
/contactsgroup:Test

"Ray Breen" <RayB...@discussions.microsoft.com> a écrit dans le message de

news:CF27AF8F-5BDE-438C...@microsoft.com...

Ray Breen

unread,
Nov 14, 2005, 1:06:05 PM11/14/05
to
When you run this command do you any messages at all? as you should see
several error messages and also confirmation that it is adding the contacts
to the users.

Jacques

unread,
Nov 14, 2005, 1:11:36 PM11/14/05
to
Here's the result of the script

Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

@------------------------------------------------------------
@ Text file with Users: contacts.txt
@ Text file with Contacts: contacts.txt
@ Contact Group for Contacts: Test
@------------------------------------------------------------
@------------------------------------------------------------
@ Adding contacts...
@ PrimaryURI: sip:Fchev...@nordiqlab1.net
@ InstanceID: {3D2724E1-9D48-BB45-AA56-ADE0DCF39942}
@ ContactGroupID: 1
@------------------------------------------------------------
[+] Put successful for contact: (sip:Fchev...@nordiqlab1.net)
[+] Put successful for contact: (sip:gfan...@nordiqlab1.net)
[+] Put successful for contact: (sip:jde...@nordiqlab1.net)
[+] Put successful for contact: (sip:Mase...@nordiqlab1.net)
[+] Put successful for contact: (sip:mlabr...@nordiqlab1.net)
[+] Put successful for contact: (sip:sboi...@nordiqlab1.net)
[+] Put successful for contact: (sip:tes...@nordiqlab1.net)
[+] Put successful for contact: (sip:tqu...@nordiqlab1.net)

@------------------------------------------------------------
@ Adding contacts...
@ PrimaryURI: sip:gfan...@nordiqlab1.net
@ InstanceID: {BE29FD7B-44A3-2148-85B4-3D437942FF66}
@ ContactGroupID: 1
@------------------------------------------------------------
[+] Put successful for contact: (sip:Fchev...@nordiqlab1.net)
[+] Put successful for contact: (sip:gfan...@nordiqlab1.net)
[+] Put successful for contact: (sip:jde...@nordiqlab1.net)
[+] Put successful for contact: (sip:Mase...@nordiqlab1.net)
[+] Put successful for contact: (sip:mlabr...@nordiqlab1.net)
[+] Put successful for contact: (sip:sboi...@nordiqlab1.net)
[+] Put successful for contact: (sip:tes...@nordiqlab1.net)
[+] Put successful for contact: (sip:tqu...@nordiqlab1.net)


"Ray Breen" <RayB...@discussions.microsoft.com> a écrit dans le message de

news:DA5879D3-929F-40C1...@microsoft.com...

Ray Breen

unread,
Nov 14, 2005, 1:19:01 PM11/14/05
to
I take i you logged in as one of these users? as that output looks fine.

Jacques

unread,
Nov 14, 2005, 1:41:16 PM11/14/05
to
It seems to work when you logged in with one of the users. But If I created
a new user in AD and connect with that user it does not work, I guess this
is normal.
Thank you

"Ray Breen" <RayB...@discussions.microsoft.com> a écrit dans le message de

news:5482A456-9E96-41C3...@microsoft.com...

Ray Breen

unread,
Nov 14, 2005, 1:49:02 PM11/14/05
to
Yea you need to run the script everytime u add a new user. I have it set to
run once a day which should catch any new users.

Jacques

unread,
Nov 14, 2005, 2:03:26 PM11/14/05
to
Thank you

"Ray Breen" <RayB...@discussions.microsoft.com> a écrit dans le message de

news:1A7E6368-7841-41BD...@microsoft.com...

Jacques

unread,
Nov 15, 2005, 2:56:08 PM11/15/05
to
Hi,
There,s another way to extract the sip of the users. If you go in the Live
Communication Server MMC et right-click on the Users node from your pool or
pools, you have the option to export the list.
Thanks
Jacques

"Ray Breen" <RayB...@discussions.microsoft.com> a écrit dans le message de
news:1A7E6368-7841-41BD...@microsoft.com...

Scott

unread,
Nov 29, 2005, 11:29:08 AM11/29/05
to
This was a great post. One question I have, hoping you may be able to answer
is that when I use dsquery without -scope onelevel, the text file that I get
has a lot of spaces and skipped lines. In the format requirements of the txt
file it says that each line needs to have a SIP entry. When I run the import
script on my text file with spaces the script pauses and needs user input
claiming invalid data. Any ideas why my file would have so many spaces or how
to avoid the import script from stopping on errors.
Thanks,
Scott

Scott

unread,
Nov 29, 2005, 11:59:11 AM11/29/05
to
As a follow up I did add the > errors.txt to the script.
It created the errors.txt file but it didn't write any errors to the file.
-Scott

Benba

unread,
Dec 8, 2005, 6:33:02 PM12/8/05
to
Hi Ray,

Did you figure out how to add the same contact to multiple contact groups?
LCSADDCONTACTS.WSF always removes existing contacts from existing groups.

Thanks!

Benjamin

u101440

unread,
Jan 10, 2006, 4:15:02 AM1/10/06
to
Ray

Still cannot thank you enough for simplifying this process for all but I've
got 2 more questions:

If I add a new user then I obviously need to run this again. By running it
again (extracting all users, adding them to the same group, auto
authorisation, etc) does this not replicate users or groups at all? I don't
want to creat multiple groups or users within LCS?

Ray, you also mention a script you run every day. Can you share this with us
as well as some of us would find this useful to have as well (i.e. me). How
are you running it?

Thanx again.

Childress@discussions.microsoft.com James Childress

unread,
Feb 15, 2006, 1:46:28 PM2/15/06
to
This is a great posting. Thank you very much for all your help. I just have a
couple questions. How can you delete an entire group not just the contacts in
the group. Also I am getting a lot of screen output that I must click ok on
after each person is added. Did you find a way to not have this. Also you
spoke of a script you run every morning is there any way you can post this
for us? Again thanks for all the great information

Chris Bauer

unread,
Apr 19, 2006, 7:37:01 PM4/19/06
to
Question about this script...say I add a person and give them a friendly name
(by adding the friendly name is the users.txt file). After I've imported,
how do I modify the friendly name without rerunning the script?

Jason

unread,
May 1, 2006, 12:46:54 PM5/1/06
to
I tried the DSquery thing and get the message: "dsquery
failed:Directory Object not found"

I am testing this in a lab, and used this syntax (exactly)
dsquery * "OU=users,DC=hcctest,DC=local" -attr
msRTCSIP-PrimaryUserAddress -scope onelevel -limit 10000 >contacts3.txt

any help would be greatly appreciated. I already got the LCSaddcontacts
to work, but it is a little confusing. After reading this thread, I
finally added all of the users to both the usersfile and the
contactsfile and it worked. But I want to be able to automate bringing
new AD users into this file somehow. If I get the dsquery thing to
work, I would have to get it to update both the users AND contacts
files??

Thanks in advance

-J

Jason

unread,
May 4, 2006, 12:44:15 PM5/4/06
to
I was able to get it to work by changing the syntax
to"CN=users,DC=hcctest,DC=local" in the dsquery command. I thought OU
was more appropriate. I don't know why CN worked and OU didn't. Anyone
have any explanation?
also the outputted text file returns msRTCSIP-PrimaryUserAddress on the
first line, and many line spaces in between 2 sets of users (like 20)
this returns errors in the output of the Addcontacts.wsf script, such
as:
[Err] invalid line in contacts3.txt (probably one for each blank line
and the msRTCSIP-PrimaryUserAddress title
is this normal? It seemed to work anyway for the lines that did have
sip:us...@domain.com in them

-J

chgrec

unread,
May 23, 2006, 12:59:10 PM5/23/06
to
Because Users is a Container (CN) not an Organizational unit (OU).....

Alan.W

unread,
Jul 25, 2006, 4:49:05 PM7/25/06
to

Scott, I sincerely hope you've fixed this problem you were having, as
this post is several months old, but in case you havn't, and are still
watching this thread, than here is what you have to add in order to get
rid of the spaces. (a scripting guru figured this out, so I cannot take
credit. I was getting roughly 50k lines of spaces)

dsquery * "DC=**,DC=**,DC=com" -attr msRTCSIP-PrimaryUserAddress -limit
10000 -q -filter (msRTCSIP-UserEnabled=TRUE) > contacts.txt

The filter helps. A LOT.


Scott wrote:
> [B]This was a great post. One question I have, hoping you may be able


> to answer
> is that when I use dsquery without -scope onelevel, the text file
> that I get
> has a lot of spaces and skipped lines. In the format requirements of
> the txt
> file it says that each line needs to have a SIP entry. When I run the
> import
> script on my text file with spaces the script pauses and needs user
> input
> claiming invalid data. Any ideas why my file would have so many
> spaces or how
> to avoid the import script from stopping on errors.
> Thanks,
> Scott

> [B]

--
Alan.W
------------------------------------------------------------------------
http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message1953698.html

Deon

unread,
Nov 6, 2006, 2:09:02 PM11/6/06
to
How can this process run outside of peak hours and i tried the scripts and i
still cannot see my contacts, plus i wanted to seperate contacts by
cities....which is becoming a real headache, because i have to roll this out
in the other cities by next monday. it works but, i had to goto each machine
and configure the advance settings and yet no contacts unless you manually
add them
0 new messages