Outlook 2011 For Mac Keeps Changing the Exchange Server Address

To update your Exchange 2007 or 2010 server you will need to run the following commands from the Exchange Management Shell and replace the Server running the Client Access Role with your external domain name. These commands update the URL for the Autodiscover service, Exchange Web Services (EWS) and the OWA Web-based Offline Address book respectively.

Before running these commands you will need to check make sure a DNS record exists mapping the IP Address to the Exchange Client Access (CAS) server.

Note: Each of these commands below should be run on a single line in the Exchange Management Shell (EMS):

Set-ClientAccessServer -Identity HostName -AutodiscoverServiceInternalUri https://mail.yourdomain.com/autodiscover/autodiscover.xmlSet-WebServicesVirtualDirectory -Identity "HostName\EWS (Default Web Site)" -InternalUrl https://mail.yourdomain.com/ews/exchange.asmxSet-OABVirtualDirectory -Identity "HostName\oab (Default Web Site)" -InternalUrl https://mail.yourdomain.com/oab

Recycle the IIS Application Pools

Next to make these commands take effect you have to tell IIS to push these changes by recycling the application pools.

  1. Open IIS Manager by clicking Start, then enter inetmgr.
  2. Expand the server and expand Application Pools, then right-click on MSExchangeAutodiscoverAppPool, and select Recycle.

Force Active Directory Sync/Replication With All Partners

From time to time I need to force sync all of my GCs aka DCs. This is a quick way to force everyone to replicate. If you have a lot of GCs this could take a while.

Syntax:
 repadmin /replicate destination_dsa Naming Context /allsources
Example:
 repadmin /replicate server1.test.com dc=test,dc=com /allsources

Destination server Name: server2.test.com
Naming Context: dc=test,dc=com (Domain partition)

How To Force SharePoint to Sync with Active Directory

Occasionally I have a user that changes their last name (or we got it spelled wrong) and I need the change to reflect across SharePoint (why SP doesn’t do this by itself I have no idea). In order to aid this process I found this script to force a resynchronize of each instance of the user profile in the user information lists. The script accepts one argument, which is the username to resync in the format DOMAN\User. Create a new powershell file with a ps1 extension and paste the code below into it.

$webapps = Get-SPWebApplication
 foreach ($webapp in $webapps) {
 [string] $login = $args[0]
 $sites = get-spsite -Limit All -WebApplication $webapp
 foreach ($s in $sites) {
 write-host $s.url
 $w = $s.RootWeb;
 $u = get-SPUser -Web $w -limit all | Where-Object {$_.userlogin -eq $login}
 if ($u -ne $null) {
 write-host "`t$($w.url)"
 Set-SPUser $u -SyncFromAD
 write-host "`tUpdated"
 }
 }
 }

After running it, you may get a few errors but you’ll notice their display name and other info is updated.

How To Export Scheduled Tasks from Windows Task Scheduler Into Excel

I am a consummate network documenter. As such I get all the details. Here’s how I grab all the task scheduler items from remote servers into my master Excel sheet.

This can be run from your workstation and exports the data in CSV format which Excel just loves.

schtasks /query /S SERVERNAME /FO CSV /V >taskscheduler-export.csv

This dumps the CSV into the current directory. Just open in Excel and massage as needed.

Sending Syslog logs from Ubuntu to a remote syslog server

I don’t know why I didn’t have notes on this already. I’ve done it dozens of times. So here’s the write up.

I use Ubuntu and it uses the syslog facility/daemon called rsyslogd. Its configuration file is located here:

/etc/rsyslog.d/50-default.conf

This file tells the deamon where to log each type of message. For example the follow entry means that all cron message are sent to /var/log/cron.log:

cron.* /var/log/cron.log
Continue reading “Sending Syslog logs from Ubuntu to a remote syslog server”

List SharePoint Folder Hierarchical Structure

I’m in the middle of auditing our massive SharePoint setup and I needed a way to list out in a hierarchical way the sites, sub-sites, libraries etc in an easy manor.

Remember this KISS principal? Keep It Simple Stupid.

I had a duh moment.

Remember the DOS days? Remember the tree command?


Graphically displays the folder structure of a drive or path.

TREE [drive:][path] [/F] [/A]

/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.

Continue reading “List SharePoint Folder Hierarchical Structure”

Getting Windows Process Command Line

Windows Server 2008 and Windows 7 introduced a neat feature in the Task Manager that allows you to see the command line that instantiated the process. This is great for telling processes apart. Especially when svchost and others can have dozens of instances.

Just click View -> Select Columns and pick Command Line at the bottom.

But what if you have Windows Server 2003 or Server 2000? I found a few tricks. They’re not as clean but they work just as well.

This one just lists the processes, their PID and the “services” that are associated with them

tasklist /svc

This one makes a nice text file with much more info

wmic process get Name,ProcessId,CommandLine /format:table > wmic_task_list.txt

The text file lists the name, process id, command line and puts it in a table in a text file. Genius!

If you want to get really geeky you can see all the wmic options using this command. It can do some really nice output.

wmic process list /format /?

Hope this helps someone! I use it on a regular basis to find out why svchost is going bat shit crazy on my servers. We all know it likes to hit full cpu usage from time to time and these commands will help you find out which process is causing it.

Most often I’ve found that it has to do with Windows Updates but you never know.