|
How to use the script OcsConfigureTelUri.wsf?
|
How to use the script "OcsConfigureTelUri.wsf"?
In the following script you need
to change only parameter defined in arrComputers = Array("OCSdc"). OCSdc
is the domain controller netbios name in my lab. Change it as per your environment.
It can be netbios name of any one of the domain controllers which is up and running.
If you are running this script on
a Domain Controller then just put a “.” as arrComputers = Array(".").
Save the following script as SIPExport.vbs
under any directory. Suppose the directory you saved this file is c:\script.
================================================================
On Error Resume Next
arrComputers = Array("OCSdc")
For Each strComputer In arrComputers
Set objWMIService = GetObject("winmgmts:\\"
& strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT
* FROM
MSFT_SIPESUserSetting","WQL",wbemFlagReturnImmediately
+ wbemFlagForwardOnly)
For Each objItem In colItems
WScript.Echo objItem.PrimaryURI
Next
Next
================================================================
Now access c:\script through command
prompt. And type following command.
Cscript SIPExport.vbs >UsersSIP.txt
Running the above command will produce
a text file UsersSIP.txt which will have SIP URI of all of the users enabled for
SIP. Open this file and remove the following lines from it...
"Microsoft (R) Windows Script
Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved."
Copy UsersSIP.txt into the folder
“WMI samples” (C:\Program Files\Microsoft Office Communications Server 2007\ResKit\WMI
Samples).
Access the WMI samples directory
from your command prompt and run the following command.
cscript ocsconfigureteluri.wsf
/sipurisfile:UsersSIP.txt phonenumberpatternsfile:phonenumberpatterns.xml
This will take the phone number field
from a user account and convert it to the proper format and populate the Line URI
field on any clients that are voice enabled in OCS.
Note: Ensure that you do have
MSXML 4.0 installed before you run above command. You can download it from
here.
|