Adding Computers to AD Group with Powershell

Adding computers from a text file like:

pc1 pc2 pc3 pc4 …

using powershell could look like that:

1 2 Get-Content "C:\file.txt" | ForEach-Object {Get-QADComputer $_ |` Add-QADGroupMember -Credential $usercredential -Identity "our_ad_group" }

Everything should be pretty clear, in the variable $usercredential are credentials for the user which has rights to modify AD group membership. […]

Wrong HomeMTA, Event ID 2937

After migrating to Exchange 2010 and deleting the last Exchange 2003 or 2007 Server, it’s possible that you’ll get event warnings coming from MSExchange ADAccess with event ID 2937. In that case you’ll see something like that:

Process w3wp.exe () (PID=5884). Object [CN=User1,OU=!Users,DC=dc,DC=test,DC=com]. Property [HomeMTA] is set to value [ Objects/Microsoft MTA DEL:e5d442f7-b37a-4b80-84e2-4212b78db7bf], it is […]

Reseting OOF state in Exchange 2010

Do you want reset the Out Of Office state for your Users so that the OOF message is not send only once to the sender while the OOF is active? Here is a small script that I’ve created for this. You can add this script to the task scheduler and run it each night. That […]

Send as Distribution Group

It’s not difficult to add a user right to send as another user. You can achieve that using Exchange Management Console and a task “Manage Send As permission”. This easy task gets more complicated if the user wants to send an E-mail as a distribution group instead sending as another user. The permission to send […]

Looking for Mailboxes not being used

Did you have a request to find all mailboxes not being used for an extended period of time? For example 180 days? You could look for Users that haven’t logged in in AD using dsquery or maybe adfind. But what if you have mailboxes that are assigned to multiple users and the mailbox owner never […]

Exporting Exchange 2010 Mailbox to PST

Below is an easy script showing how to export a user Mailbox to a .pst file and subsequently how to send an E-mail to specified user with the information of successful (or not) export.

#Create export task and save the pst file to a network share New-MailboxExportRequest -Mailbox "User1" -BadItemLimit ’20’ -FilePath "\\mailboxserver\pstexport$\"   #Create […]

Configuring Exchange 2010 Services for using wildcard certificates

I recognized, that many people do have problems with configuring Exchange with wildcard certificates. The reason for this is probably that it’s not possible to configure all services the same way and each need a special configuration that the administrator have to think of. I’ll try to give you a comprehensive guide how to configure […]

Exchange 2010 Tracking Log for last 30 minutes

Here is a script I made to get a tracking log from Exchange hub transport server for last 30 minutes.

get-messagetrackinglog -EventID "RECEIVE" -Server hub2 -Start (((get-date -UFormat "%m-%d-%Y")` + " " + ((Get-Date).Addminutes(-30)).ToLongTimeString())) | ft Sender, recipients, MessageSubject, Timestamp

I’m using -UFormat for the date as it’s most comfortable for me, but you can […]

Editing Multivalued Property with PowerShell

You have a Receive Connector with allowed IP addresses that need to be changed from time to time? Editing the connector with Exchange GUI is one of the options you could use, but there is a much better, faster and more convinced method to do that. Let say we have a receive connector on server […]