Pages

Monday, September 4, 2017

How to list all DND-enable extensions

List DND-enabled extensions

If the DND is set using the DND feature of the IP-Phone then there is no way you can list them. Otherwise, if it is set using FreePBX feature code (*78) then here is the way to do it:


in linux prompt run:
# asterisk -rx “database show DND” or
#asterisk -rx “database show” | grep “/DND/”
# asterisk -rx "database show DND"
/DND/1002                                         : YES
/DND/1004                                         : YES
/DND/1006                                         : YES
/DND/1007                                         : YES

To remove DND from an extension run:

# asterisk -rx “database del DND ext.”

Monday, July 24, 2017

Export AD Users to CSV using Powershell Script

Export AD Users to CSV using Powershell Script

Description:

We can easily export Active Directory users to CSV file using Powershell cmdlets Get-ADUser and Export-CSV. In this article, I am going to write Powershell script samples to Export AD Users to CSV file and Export AD Users from Specific OU to CSV file using Powershell Script.

Summary:

Export AD Users to CSV using Powershell

The following command export the selected properties of all Active Directory users to CSV file. You can add more attributes as per your wish, refer this article:Get-ADUser Default and Extended Properties to know more supported AD attributes.
1
2
3
4
Import-Module ActiveDirectory
Get-ADUser -Filter * -Properties * |
 Select -Property Name,Mail,Department |
 Export-CSV "C:\\AllADUsers.csv" -NoTypeInformation -Encoding UTF8
Export AD Users to CSV using Powershell Script

Export AD Users to CSV with Filter using Powershell

This command export the selected properties to CSV file of AD users whose City contains the text 'Austin'.
Note: Refer this article:Get-ADUser Default and Extended Properties to know more supported AD attributes.
1
2
3
4
Import-Module ActiveDirectory
Get-ADUser -Filter 'City -like "*Austin*"' -Properties * |
  Select -Property Name,City,Mail,Department,DistinguishedName |
  Export-CSV "C:\\ADUsers.csv" -NoTypeInformation -Encoding UTF8

Export AD Users by LDAP Filter:

Instead of SQL Like Filter, you can also use LDAP Filter to select only required users. Refer this article (AD LDAP Filter Examples) to get more LDAP filter examples. The below command exports all the users who are belongs to Admin department.
1
2
3
4
Import-Module ActiveDirectory
Get-ADUser -LDAPFilter '(Department=*Admin*)' -Properties * |
  Select -Property Name,City,Mail,Department,DistinguishedName |
  Export-CSV "C:\\AdminUsers.csv" -NoTypeInformation -Encoding UTF8

Export ADUsers CSV output:

Get-ADUser - Export Selected properties to CSV file

Export AD Users from specific OU to CSV using Powershell

We can set target OU scope by using the parameter SearchBase. This following command select all the AD users from the Organization Unit 'Austin' and export it to CSV file.
1
2
3
4
Import-Module ActiveDirectory
Get-ADUser -Filter * -SearchBase "OU=Austin,DC=TestDomain,DC=Local" -Properties * |
 Select -Property Name,Mail,Department |
 Export-CSV "C:\\AustinUsers.csv" -NoTypeInformation -Encoding UTF8
Export AD Users from specific OU to CSV using Powershell Script

Wednesday, June 28, 2017

Tách Họ, Tên, Chữ lót trong Excel


Tách Họ, Tên, Chữ lót trong Excel

HỌ: =LEFT(B2,FIND(" ",B2,1)-1)
Đệm: =TRIM(REPLACE(LEFT(B2,FIND("*",SUBSTITUTE(B2," ","*",LEN(B2)-LEN(SUBSTITUTE(B2," ",""))))-1),1,FIND(" ",B2,1)-1,""))
Tên: =RIGHT(B2,LEN(B2)-FIND("*",SUBSTITUTE(B2," ","*",LEN(B2)-LEN(SUBSTITUTE(B2," ","")))))


Monday, May 15, 2017

vSphere vCenter : 503 service unavailable

vSphere vCenter : 503 service unavailable

Having either of these errors can lead to some services not started on the vCenter server.

503 Service Unavailable (Failed to connect to endpoint: [class Vmacore::Http::NamedPipeServiceSpec:00000000011D7F00] _serverNamespace = / _isRedirect = false _pipeName =\\.\pipe\vmware-vpxd-webserver-pipe)
503 Service Unavailable (Failed to connect to endpoint: [class Vmacore::Http::LocalServiceSpec:00000000012B0BA0] _serverNamespace = /vsphere-client _isRedirect = false _port = 9090)
If your vCenter is running on a Windows box, checking the status of its services can provide some first-hand information :
cd C:\Program Files\VMware\vCenter Server\bin
./service-control --status
To stop all the services :
./service-control --stop --all
To start all the services :
./service-control --start --all

Monday, April 24, 2017

Admin Fix: X500 Address

Note: This document is intended for Exchange? Administrators.
When you send email to someone who has a working Exchange mailbox and get an error like the one below, it usually means that the "legacyExchangeDN" attribute on the mailbox has changed.

 IMCEAEX-_O=OREGON+20STATE+20UNIVERSITY_OU=EXCHANGE+20ADMINISTRATIVE+20
 GROUP+20+28FYDIBOHF23SPDLT+29_CN=RECIPIENTS_CN=User@oregonstate.edu
 #550 5.1.1 RESOLVER.ADR.ExRecipNotFound; not found ##

There are several reasons that can happen, but the most common case is that the mailbox was deleted and a new one was created with the same email address.
Outlook clients will try to send to the mailbox using the old legacyExchangeDN in the following cases:
  • Sending to a local contact stored for that person
  • Sending to an entry in the Outlook Nickname cache
  • Replying to an old email the person sent
Although it is possible to solve this problem by clearing the nickname cache and removing old contacts for all the senders who are effected, that is not really practical and replies to old emails will still bounce. The better solution is to add an X500 address to the new mailbox, so that mail can be properly routed.

To get the right syntax for the X500 address, use the text from the bounce message.
  • Remove the leading text "IMCEAEX-"
  • Change underscores to forward slashes
  • Change +20 to a space
  • Change +28 to an open parenthesis
  • Change +29 to a close parenthesis
  • Change +2E to a period

In the example above, the error provides this text:
 IMCEAEX-_O=OREGON+20STATE+20UNIVERSITY_OU=EXCHANGE+20ADMINISTRATIVE+20
 GROUP+20+28FYDIBOHF23SPDLT+29_CN=RECIPIENTS_CN=User@oregonstate.edu

The X500 address should be:
 /O=OREGON STATE UNIVERSITY/OU=EXCHANGE ADMINISTRATIVE GROUP
 (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=User@oregonstate.edu

To add the X500 address to the affected account:
  • Open properties for the user account in Active Directory Users & Computers.
  • Choose the "E-mail Addresses" tab.
  • Click on "Add" and choose "Custom Address".
  • Enter the X500 address with the correct syntax per the steps above.
  • Choose "X500" for the "E-mail type".
  • Click OK twice to save.
  • Have one of the affected senders test sending to this account.

Tuesday, March 21, 2017

To make it easier to access the BIOS setup screen

To make it easier to access the BIOS setup screen, edit the virtual machine's configuration (.vmx) and add or edit one of these options:
bios.forceSetupOnce = "TRUE"
This forces entry to the BIOS setup at startup.
bios.bootDelay = "xxxx"
This adds a delay to the initial POST screen, showing it for longer and giving you more time to access the BIOS setup, where xxxx is the number of milliseconds to show the POST screen. (There are 1000 milliseconds in a second.) The maximum value for the boot delay is 10000 milliseconds or 10 seconds.

Thursday, October 6, 2016

Exchange – Message Not Sent 'Because there are too many recipients'

When attempting to send an email to a large amount of recipients, you may see the following error;
   
This message wasn’t delivered to anyone because there are too many recipients, the limit is {number}. This message has {number} recipients
 
To check what the limit is set to launch the Exchange Management Shell, and ecxecute the following command;
 
Get-TranportConfig
   
To raise the limit (in this example to 2000) use the following command;
 
Set-TranportConfig -MaxRecipientEnvelopeLimit 2000