Company normalization rules (client side) for Office Communications Server 2007Friday, April 24. 2009
We use RCC and our Mitel controller expects a leading zero when dialing an outside number.
I used the following normalization rules in the file \Microsoft Office Communications Server 2007\Web Components\Address Book Files\Files\Company_Phone_Number_Normalization_Rules.txt # Match a phonenumber that starts with +31. # '[\s()\-\./]*' means Match any immediately following characters if they are a space ( ) dash or period. # followed by 9 digits (place in variable $1) # This is a national number. CODE: \+31[\s()\-\./]*(\d{9}) #Add a leading zero for outside line and an extra zero for the areacode. CODE: 00$1 # Match a phonenumber that starts with +xx (place the xx in variable $1). # '[\s()\-\./]*' means Match any immediately following characters if they are a space ( ) dash or period. # followed by 8 or 9 digits (place in variable $2) # This is an international number. CODE: \+(\d\d)[\s()\-\./]*(\d{8,9}) #Add a leading zero for outside line and two zeros for international dialling. CODE: 000$1$2 # Full National Numbers 0302643660 # In the following formats 03 0264 3660, (0) 309264-3660, 0302643660 etc. CODE: [(]*0(\d)[)-]*\s*(\d)[-\.]*\s*(\d)[-\.]*\s*(\d)[-\.]*\s*(\d)[-\.]*\s*(\d)[-\.]*\s*(\d)[-\.]*\s*(\d)[-\.]*\s*(\d) CODE: 00$1$2$3$4$5$6$7$8$9 Get ip of local computerTuesday, March 17. 2009
This script is a quick way to obtain the local computer's ip address.
Works best if the computer has only 1 ip address. set s = WScript.CreateObject("WScript.Shell") on error resume next do i = i + 1 ServiceName = s.regread("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\" & cstr(i) & "\ServiceName") ip = s.regread("HKLM\SYSTEM\ControlSet001\Services\" & ServiceName & "\Parameters\Tcpip\DhcpIPAddress") loop until len(ip) > 0 or i = 10 on error goto 0 wscript.echo ip Random password generator vbscriptSunday, January 25. 2009
Finally! The ultimate random password generator script. Compatible with the Active Directory password complexity requirement domain policy.
In the example below a password of 8 characters is constructed. It starts with 3 capitals then 4 lowercase letters and ending with a random digit. The O, I, o, l and 0 are left out to avoid confusion. strPwd1 = GeneratePassword("ABCDEFGHJKLMNPQRSTUVWXYZ", 3) strPwd2 = GeneratePassword("abcdefghijkmnpqrstuvwxyz", 4) strPwd3 = GeneratePassword("123456789", 1) WScript.Echo strPwd1 & strPwd2 & strPwd3 Function GeneratePassword(strCharacters, intLength) Randomize Dim strS, intI For intI = 1 To intLength strS = strS + Mid(strCharacters, Int(Rnd() * Len(strCharacters))+1, 1) Next GeneratePassword=strS End Function Install after Ubuntu installFriday, January 23. 2009
sudo apt-get update
sudo apt-get upgrade sudo apt-get install ubuntu-restricted-extras k3b vlc guake gftp xchat gtkpod sbackup openssh-server Installing curved AWN bar in UbuntuThursday, January 01. 2009
For Hardy Herron (8.04) use the following commands:
echo 'deb http://ppa.launchpad.net/reacocard-awn/ubuntu hardy main' | sudo tee -a /etc/apt/sources.list echo 'deb-src http://ppa.launchpad.net/reacocard-awn/ubuntu hardy main' | sudo tee -a /etc/apt/sources.list sudo apt-get update sudo apt-get install avant-window-navigator-bzr awn-core-applets-bzr awn-manager-bzr Start it with this command: avant-window-navigator If you want a curved bar, press F2 and execute gconf-editor, set apps->avant-window-navigator->bar->set bar_angle to -1. For Intrepid Ibex (8.10) use the following commands: echo 'deb http://ppa.launchpad.net/reacocard-awn/ubuntu intrepid main' | sudo tee -a /etc/apt/sources.list echo 'deb-src http://ppa.launchpad.net/reacocard-awn/ubuntu intrepid main' | sudo tee -a /etc/apt/sources.list sudo apt-get update sudo apt-get install avant-window-navigator-bzr awn-core-applets-bzr awn-manager-bzr xfwm4 xcompmgr libawn-bzr-dev libawn0-bzr Open menu-system-preferences-sessions. Add new sessions: - compiz - xcompmgr - xfwm4 - avant-window-navigator-delay Handy Ubuntu linksWednesday, October 15. 2008How to install multimedia support on Ubuntu Hardy HeronWednesday, October 08. 2008Use Exchange Management Shell to create domain usersSunday, March 23. 2008
Here's an example of a powershell script I use to create active directory users using the Exchange management shell.
It creates users, with mailbox, home directory (including appropriate permissions), profile directory and several AD attributes. All input is checked using regular expressions. Note that this example contains the -WhatIf statement for all cmdlets. You will have to remove it before it will actually work. Requirements: - Exchange 2007 Management Shell Snapin - Quest Active Roles management PS snapin (Free PowerShell Commands for Active Directory) - xcacls.vbs in same directory as script. Write-Host "============ Create new domain user ============" -foregroundcolor Cyan $username = Read-Host "Username " ## check if only letters were used $regex = "^([a-zA-Z]+)$" ## only text, no spaces, no numbers If ($username -notmatch $regex) { Write-Host "Invalid username specified. $username" -foregroundcolor Cyan break } ## Check if there's already a user with this samAccountName $dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() $domainnb = "DOMAIN" $root = $dom.GetDirectoryEntry() $search = [System.DirectoryServices.DirectorySearcher]$root $search.Filter = "(samAccountName=$username)" $result = $search.FindOne() if ($result -ne $null) { $user = $result.GetDirectoryEntry() Write-Host "There is already a useraccount $username." -foregroundcolor Cyan Write-Host "User found: " $user.distinguishedName -foregroundcolor Cyan break } $surname = read-host "User's last name (surname) " $regex = "^([a-zA-Z'-]+)$" ## allows characters and dashes only If ($surname -notmatch $regex) { Write-Host "Invalid surname specified. $surname" -foregroundcolor Cyan break } $tussenvoegsel = read-host "Infix. I.e. van den " $name = Read-Host "User's first name " $tel = Read-Host "Extension number " $regex = "^(7|8)\d{3}$" ## 4 digit extension numbers, starting with 7 or 8 only. If ($tel -notmatch $regex) { Write-Host "Invalid extension number specified. $tel" -foregroundcolor Cyan break } $passwd = Read-Host "Specify user's password " ## Password must be at least 6 characters, ## no more than 15 characters, ## and must include at least one upper case letter, ## one lower case letter, and one numeric digit. $regex = "^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,15}$" If ($password -notmatch $regex) { Write-Host "Invalid password specified. $password" -foregroundcolor Cyan break } $DisplayName = "$surname, $name $tussenvoegsel" $homeroot = "\\server1\mydocuments" $profileroot = "\\server1\profiles" Write-Host "================================================" -foregroundcolor Cyan Write-Host "Creating user $DisplayName using New-Mailbox cmdlet.." -foregroundcolor Cyan New-Mailbox -Name $DisplayName.Trim() ` -Database "EXCHSRVR\Mailbox Store\Mailbox Database" ` -Password (convertto-securestring $passwd -asplaintext -force) ` -UserPrincipalName $username@DOMAIN.LOCAL ` -ActiveSyncMailboxPolicy "Default" ` -Alias $username ` -Confirm ` -DisplayName ($DisplayName.Trim()) ` -FirstName "$name $tussenvoegsel" ` -LastName $surname ` -OrganizationalUnit "DOMAIN.LOCAL/OU Users" ` -ResetPasswordOnNextLogon $true ` -SamAccountName $username ## Wait for DC's to pick up change Start-Sleep -s 10 ## Modify user properties Get-QADUser $username | Set-QADUser -PhoneNumber $tel ` -UserPassword $passwd Write-Host "================================================" -foregroundcolor Cyan ## Create home directory with permissions If ( !(Test-Path -Path "$homeroot\$username" -PathType Container) ) { ## Doesn't exist so create it. Write-Host "home directory doesn't exist. Creating home directory." -ForegroundColor Cyan ## Create the directory New-Item -path $homeroot -Name $username -ItemType Directory $homedir = "$homeroot\$username" ## Modify Permissions on homedir ## Instead of using the .NET approach of setting NTFS permissions, using xcacls is quicker: cscript xcacls.vbs $homedir /E /G `"$nbdomain\$username`":M ## The .NET approach - remmed out ## To list available rights options, run: [system.enum]::getnames([System.Security.AccessControl.FileSystemRights]) ## To list available inheritance flags, run: [system.enum]::getnames([System.Security.AccessControl.InheritanceFlags]) ## Idem for Propagation flags. #$newrights = [System.Security.AccessControl.FileSystemRights]"Modify" #$InheritanceFlag = [System.Security.AccessControl.InheritanceFlags]::"ObjectInherit" #$PropagationFlag = [System.Security.AccessControl.PropagationFlags]::"InheritOnly" #$Typ = [System.Security.AccessControl.AccessControlType]::Allow #$ID = new-object System.Security.Principal.NTAccount($domainnb + "\" + $username) #$SecRule = new-object System.Security.AccessControl.FileSystemAccessRule($ID, $newrights, $InheritanceFlag, $PropagationFlag, $Typ) #$myACL = Get-Acl -Path $homedir #$myACL.AddAccessRule($SecRule) #Set-ACL -AclObject $myACL $homedir } Else { Write-Host "home directory already exists. Script end." -ForegroundColor Cyan Break } ## Create Profile directory with permissions If ( !(Test-Path -Path "$profileroot\$username" -PathType Container) ) { ## Doesn't exist so create it. Write-Host "profile directory doesn't exist. Creating profile directory." -ForegroundColor Cyan ## Create the directory New-Item -path $profileroot -Name $username -ItemType Directory $profiledir = "$profileroot\$username" ## Modify Permissions on profile dir ## Instead of using the .NET approach of setting NTFS permissions, using cacls is quicker: cscript xcacls.vbs $profiledir /E /G `"$nbdomain\$username`":M ## The .NET approach - remmed out ## To list available rights options, run: [system.enum]::getnames([System.Security.AccessControl.FileSystemRights]) ## To list available inheritance flags, run: [system.enum]::getnames([System.Security.AccessControl.InheritanceFlags]) ## Idem for Propagation flags. #$newrights = [System.Security.AccessControl.FileSystemRights]"Modify" #$InheritanceFlag = [System.Security.AccessControl.InheritanceFlags]::"None" #$PropagationFlag = [System.Security.AccessControl.PropagationFlags]::"None" #$Typ = [System.Security.AccessControl.AccessControlType]::Allow #$ID = new-object System.Security.Principal.NTAccount($domainnb + "\" + $username) #$SecRule = new-object System.Security.AccessControl.FileSystemAccessRule($ID, $newrights, $InheritanceFlag, $PropagationFlag, $Typ) #$myACL = Get-Acl -Path $profiledir #$myACL.AddAccessRule($SecRule) #Set-ACL -AclObject $myACL $profiledir } Else { Write-Host "profile directory already exists. Script end." -ForegroundColor Cyan Break } ## Modify user properties Get-QADUser $username | Set-QADUser -ObjectAttributes @{homeDrive='H:';homeDirectory=$homedir;profilePath=$profiledir} ## User created. Listing properties $info = Get-QADUser $username -IncludeAllProperties | fl DN,Name,DisplayName,userPrincipalName, ` samAccountName,givenName,sn,homeDrive,homeDirectory, ` ProfilePath,telephoneNumber,email Write-Host "User created with the following properties: " -ForegroundColor Cyan $info Write-Host "================= Script End =================" -foregroundcolor Cyan Office Communicator 2007 and PowershellWednesday, January 09. 2008
$communicator = new-object -comobject Communicator.UIAutomation
Use Powershell to extract OCS info from active directoryFriday, October 05. 2007
Use Quest's free Powershell ActiveRoles Management Shell snapin to get a list of OCS enabled users with their corresponding Line URI.
Get the snapin here: Powershell cmdlets for Active Directory get-qaduser -LDAPFilter '(msRTCSIP-UserEnabled=TRUE)' -IncludedProperties 'msRTCSIP-Line' | Format-table DN,msRTCSIP-Line Enable existing user for Communications ServerThursday, October 04. 2007
Here's a vbscript that lets you enable an existing AD user for OCS.
Analyze the script carefully because it will most likely need modification to reflect to your own environment. [geshi lang=vb] Set objUser = GetObject("LDAP://cn=ZZBond\, James,ou=Test 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 [/geshi]
(Page 1 of 3, totaling 33 entries)
» next page
Competition entry by David Cummins powered by Serendipity v1.0 |
Blog AdministrationChange template |