Set-SendAsPermission


posted by Richard Giles
03-01-2009

Downloads: 381
File size: 774 B
Views: 1,673

Embed
Set-SendAsPermission
  1. # Matt Brown 
  2. # http://universitytechnology.blogspot.com/2009/01/powershell-exchange-2007-bes-blackberry.html 
  3. # Setting up users for Blackberry Enterprise Server environment with Exchange 2007.  
  4. # The script gives the BESAdmin account Send-As permission on the AD Account.  
  5.  
  6. # Open the File of User Names and Put it in the Pipeline 
  7. $import = Import-Csv "NewBlackBerryAccounts.txt" 
  8. $domain = "mydomain.com" 
  9.  
  10. # Loop Through the CSV File, creating accounts 
  11. $import | foreach
  12.    # Set Vars 
  13.    $StrUserName = $_.Username 
  14.  
  15.    $user = get-qaduser $StrUserName@$domain 
  16.    if($user) { 
  17.       $dn = $user.DN 
  18.       Add-ADPermission -Identity $dn -User 'mydomain\BESAdmin' -ExtendedRights 'Send-as' 
  19.    } else
  20.       write-host Username $_.Username not found 
  21.    

Setting up users for Blackberry Enterprise Server environment with Exchange 2007. The script gives the BESAdmin account Send-As permission on the AD Account.

Attributed To: Matt Brown

URL: http://universitytechnology.blogspot.com/2009/01/powershell-exchange-2007-bes-blackberry.html

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.