Microsoft Office Tutorials and References
In Depth Information
Completing Orchestrator integration and finalizing a runbook
12. Use a Windows PowerShell script to synchronize the newly created account in Active
Directory with Office 365. Enter the script (copy and paste) into the Script area of the
activity. Change the three variables (right-click Subscribe) created earlier for
ADFSServer, Admin-Name, and Admin-Password for Office 365 access. Use the following
script in the Run .Net Script activity:
$ErrorActionPreference = "Stop"
try
{
   $DomainPassword = ConvertTo-SecureString Admin-Password -AsPlainText -Force
   $DomainCred = New-Object -TypeName System.Management.Automation.PSCredential
-ArgumentList  Admin-Name,$DomainPassword
     $Result = Invoke-Command -ComputerName ADFS-Server -Credential $DomainCred
-ScriptBlock {
                   C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
-psconsolefile "C:\Program Files\Microsoft Online Directory Sync\DirSyncConfig-
Shell.psc1" -command "Start-OnlineCoexistenceSync"
        }
      $Result
}
catch
{
  Throw $_.Exception
}
Search JabSto ::




Custom Search