Skip to main content

Office 365 Powershell command(s) for DIRSYNC

I had an interesting session with the Office365 technical Support team and learned a few new commands today.

The first this to remember is that there are 3 possible system scenarios for running Powershell command:
  • A  system with DIRSYNCinstalled
  • An On-Premise Exchange management System
  • Any other computer with Neither of the able installed.
The goal here is to run PowerShell with the necessary privileges and Snapins to be able to perform the tasks.

At one point, the Support Technician wanted me to run "Get-Mailbox" and also "Start-OnlineCoexistenceSync".

GET-MAILBOX
The Get-Mailbox commandlet sounds easy, but remember that this is for Office365, not the on-premise Exchange.
To run this commandlet, we were able to perform the task on any PC.  (It does not need to be in the domain of the Dirsync server.)
Type to following commands:
PS C:\Windows\system32> Set-ExecutionPolicy unrestricted
PS C:\Windows\system32> $cred = Get-Credential
PS C:\Windows\system32> $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionURI https://ps.outlook.com/powershell/ -Credential $cred -Authentication Basic -AllowRedirection
PS C:\Windows\system32> Import-PSSession $session
PS C:\Windows\system32> Get-Mailbox


Start-OnlineCoexistenceSync
 The Start-OnlineCoexistanceSync commandlet needs to be run on the server that has DIRSYNC installed.  It also must be run in Powershell with Elevated Previledges.

PS C:\Windows\system32>Add-PSsnapin Coexistence-Configuration

(Note: for this step, there is a PSC1 file in C:\Program Files\Microsoft Online Directory Sync, but the above command works.)
PS C:\Windows\system32> Start-OnlineCoexistenceSync

Note that you will not get any feedback from this command, but if you launch
"C:\Program Files\Microsoft Online Directory Sync\SYNCBUS\Synchronization Service\Bin\MIICLIENT.EXE", you will see 3 events that occur when a synchronization occurs.



Comments

Popular posts from this blog

"Blinky" TDOA RDF Detector

Our local Amateur Radio club is building a Radio Direction Finding TDOA (Time Difference of Arrival) detector that has LED's to indicate the direction (Left or right) of the fox.  Here are the build instructions.   (Note: this project was originally presented by NZ1J.  See his video:   https://www.youtube.com/watch?v=mNqUKYkifOo&t=68s   ) Here is the completed project: We start with the schematic:   Note that you either install PIN Diode pairs s D3 and D2, or Diodes pair D1 and D4.   The difference between these is the packaging.  If you are ok with Surface mount, then install D1/D4.  If you want discrete components use D3/D2. Next is the PCB.   The PCB can be ordered using the GRBR files available from the author.  The BOM for the electronic parts is as such: Doppler Direction Finder Bill of Materials   11/12/2021        Qty Part Digi-key Part Numbe...

Radio Direction Finding - TDOA

This article describes a few projects that I built from plans for Amateur Radio Fox Hunting. Basically, the hobby/sport is for someone to hide a few low power "Foxes", which are small transmitters that beep or send Morse Code, and then have a bunch of HAM's try to find them. The first project that I built was a Yagi Antenna (Directional receiver) and a 4MHZ Offset Attenuator.  The attenuator is needed when you get close to the fox and you need to reduce the power of the received signal.  I struggled with this setup because, on my first 2 fox hunts, there was too much reflection and multi-path interference.  This causes false direction detection and if you are not mentally prepared for this, you want to throw all of your equipment into a garbage can and take up a different hobby.   There are some truly strange individuals who find this frustration fun and enjoy making other people suffer, but I will leave that discussion for another day.  Anyw...

Repetier host "Exception during socket read:Too many items in the combo box" - Solved!

I purchased a new BoXZY (3D printer, laser and CNC Mill) and have been pretty pleased so far. See https://boxzy.com/ One little issue though is that I have been trying to configure it so that I can 3D print from my laptop without having to connect a USB cable to the printer. The layout in my office is not convenient for the cable to span across the room.  Also, when I start using it for CNC Milling, I do not want to necessarily have my laptop too close to the router making all the dust.  My first attempts to install Repetier Server on various platforms was less than successful. I found that I often would get the error message "Exception during socket read:Too many items in the combo box" when I connected the application to whatever server that I configured. What confused me is that it would work perfectly on one of several computers,. but I could not find a root cause. In addition, I received a Smart Controller (Beta) from BoXZY which came with Windows 10 H...