Find Online Outsourced Projects - freelance graphic designer, programmer jobs

.NET Accounting / Bookkeeping AJAX ASP Audio Services C/C++ CMS Cold Fusion Copywriting CSS Data Entry Data Processing Delphi Electronics Engineering Excel Flash Graphic Design Handheld J2EE Java Javascript Joomla JSP LDAP Legal Advice Link Building Links Linux Logo Design Market Research Marketing MS Access MS SQL mSQL Multimedia MySQL Oracle OsCommerce PDA Perl/CGI Photography Photoshop PHP PostgreSQL Project Management Proofreading Python Ruby/Ruby on Rails Script Installation Security SEO SQL System Admin Telemarketing Training Translation Video Services Virtual Reality Visual Basic Web Promotion Website Design Website Security Windows Wireless Wordpress Writing XHTML XML

Find freelance programmers at ScriptLance.com - Search worldwide

Exchange07 Powershell script

Tue, 25 Nov 2008 16:33:34 GMT

Budget: N/A
Category: LDAP

I am looking for a script to search all disabled user accounts in Active Directory within an OU and it's sub OU's and disable the mailbox in Exchange 2007. I have the commands to do this but not sure how to put it all together. Below are sample scripts that can help build the final script

Disable user accounts on Windows 2003 after 30 days of non-use:

Add-PSSnapin Quest.ActiveRoles.ADManagement -ea 0
$LastLogonTime = ([System.DateTime]::Now).AddMonths(-1).ToFileTime()
$filter = "(&(!(userAccountControl:1.2.840.113556.1.4.803:=2))(lastLogonTimeStamp<=$LastLogonTime))"
Get-QADUser -LdapFilter $filter -pagesize 0 | Disable-User -whatif


Disable Exchange mailbox:

Disable-Mailbox <mailboxID>

Free Advertising