Powershell to get list of users who’s Dial in option is enabled in Active Directory

Powershell to get the list of users who has Dial in option is enabled in Active directory.  This has to be executed in Quest Active Roles management console. This will query all the active directory users and get the details if the user object has Dialin option is enabled

Get-QADUser -IncludeAllProperties | ?{$_.msNPAllowDialin -eq $true} |Select Displayname,mailnickname

Below powershell helps you to enable export dial in enabled users to CSV format file

Get-QADUser -IncludeAllProperties | ?{$_.msNPAllowDialin -eq $true} |Select Displayname,mailnickname | Export-Csv C:\Dialinusers.csv

Executing Exchange Powershell cmdlets and Active directory cmdlets on a single PowerShell

Many times we will have requirement to execute Exchange Comlets and Active Directory(Active Roles) cmdlets on a singlewindow. As we cannot execute exchange cmdlets in  AD shell and vice versa. We have to add snap in to the powershell to execute both cmdlets on a single shell.

1. Need to make sure both Exchange managelent tools and Quest Active role management shell for active directory has been isntalled on the machine
2. Create C:\ExchangeAd.ps1 file with following lines in it

 Add-PSSnapin Quest.ActiveRoles.ADManagement
 Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin

3. Open Windows powershell and type C:\exchangead.ps1 to add snapin to the windowspowershell. You can execute both the commands on the single shell
4. Or you can Cretae a bat file which contain follwing line and place into your desktop. For Easy accability

       C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -noexit -command C:\ExchangeAd.ps1

5. You can also execute Quest snapin into Exchange powershell or Exchange snapin into Activeroles shell to execute other commands on the same window.