quinta-feira, junho 18, 2009

Habilitar Usuários para Enterprise Voice por Script

Se você quiser habilitar usuários para utilizar o OCS em lote, ou seja através de um script segue um exemplo.

Fonte: http://www.haverhoek.nl/index.php?/archives/23-Enable-existing-user-for-Communications-Server.html

Set objUser = GetObject("LDAP://cn=user1,ou=OCS Users,dc=domain,dc=local")
WScript.Echo "Enabling user '" & UCase(objUser.get("samAccountName")) & "' for Communications Server..."
strPrimaryUserAddress = "sip:" & objUser.get("mail")
WScript.Echo "Setting sip URI to '" & UCase(strPrimaryUserAddress) & "'"
bFederationEnabled = False
WScript.Echo "Federation enabled: " & CStr(bFederationEnabled)
nArchivingEnabled = 0
WScript.Echo "Archiving enabled: " & nArchivingEnabled
bInternetAccessEnabled = False
WScript.Echo "Remote user access enabled: " & CStr(bInternetAccessEnabled)
strLine = "tel:+3170778" & objUser.get("telephoneNumber") & ";ext=" & objUser.get("telephoneNumber")
WScript.Echo "Line URI: " & strLine
' The msRTCSIP-OptionFlags attribute specifies the different options that are enabled For
' the user. It's a bit-mask value of type integer. Each option is represented by a bit.
' Valid value types are:
' 1: Enabled for public IM connectivity
' 2: Reserved
' 4: Reserved
' 8: Reserved
' 16: RCC (Remote Call Control) enabled [telephony]
' 64: AllowOrganizeMeetingWithAnonymousParticipants
' 128: UCEnabled (enable user for unified communications)
' 256: EnabledForEnhancedPresence
' 512: RemoteCallControlDualMode
' 1024: Enable auto-attendant
' Example: 449 = 256 (Enhanced presence) + 128 (UC enabled) + 64 (anonym. participants) + 1 (public IM)
nOptionFlags = 256
WScript.Echo "user option flags: " & nOptionFlags & " (=EnabledForEnhancedPresence)"
strPrimaryHomeServer = "CN=LC Services,CN=Microsoft,CN=OCSPOOL,CN=Pools,CN=RTC Service,CN=Microsoft,CN=System,DC=domain,DC=local"
WScript.Echo "user will be homed on " & strPrimaryHomeServer
If MsgBox("Continue?", 4) <> 6 Then
WSCript.quit
End If
WScript.Echo "YES clicked, setting Active Directory properties..."
objUser.put "msRTCSIP-PrimaryUserAddress", strPrimaryUserAddress
objUser.put "msRTCSIP-FederationEnabled", bFederationEnabled
objUser.put "msRTCSIP-ArchivingEnabled", nArchivingEnabled
objUser.put "msRTCSIP-InternetAccessEnabled", bInternetAccessEnabled
objUser.put "msRTCSIP-Line", strLine
'objUser.put "msRTCSIP-LineServer
'objUser.put "msRTCSIP-UserExtension
'objUser.put "msRTCSIP-UserPolicy
objUser.put "msRTCSIP-OptionFlags", nOptionFlags
'objUser.put "msRTCSIP-OriginatorSid
objUser.put "msRTCSIP-PrimaryHomeServer", strPrimaryHomeServer
'objUser.put "msRTCSIP-TargetHomeServer
objUser.put "msRTCSIP-UserEnabled", True
objUser.setinfo

Nenhum comentário: