Thursday, December 31, 2015

[EX2010] Connect Remote EMS to Exchange Server




  • Enable the Windows Integrated authentication in the Powershell virtual directory




    • Use your network logon account to connect to a remote Exchange 2010 server


$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://FQDNofExchangeServer>/PowerShell/ -Authentication Kerberos

Import-PSSession $Session



    • Use a user account that you specify to connect to a remote Exchange 2010 server


$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://FQDNofExchangeServer/PowerShell/ -Authentication Kerberos -Credential $UserCredential

Import-PSSession $Session



Thursday, December 24, 2015

[OFF] Remove Office installation




Fixit to remove Office 2007, 2010: https://support.office.com/en-us/article/Uninstall-or-remove-Microsoft-Office-2010-suites-90635a1d-aec8-4653-b358-67e1b766fc4d

Fixit to remove Office 2013, 2016 and 365: http://support.microsoft.com/kb/2739501/pt-br


For licensing issues:

Apply the correspondent fixit
rename the file token.dat in "C:\Windows\System32\spp\store\2.0\tokens.dat"
Restart the workstation and install Office again

[EX2010] Export Mailboxes to PST



Get-Mailbox –OrganizationalUnit domain.ca/OUName | foreach { New-MailboxExportRequest -Mailbox $_.Alias -FilePath (‘\\server\share\’ + ($_.alias) + ‘.pst’) }

Tuesday, December 8, 2015

[WSRV] Create shortcut to "Find" in ADUC




C:\Windows\System32\rundll32.exe dsquery.dll,OpenQueryWindow

Monday, December 7, 2015

[O365] Migrating mailbox to cloud


$LiveCred = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection

Import-PSSession $Session

---------------

$OnPremCreds = Get-Credential

$MigrationEndpointOnPrem = New-MigrationEndpoint -ExchangeRemoteMove -Name OnpremEndpoint -Autodiscover -EmailAddress henwal@azurelab.dk -Credentials $OnPremCreds

In this example, we will migrate all users listed in a CSV file located on our system partition:

$OnboardingBatch = New-MigrationBatch -Name MigrationBatch1 -SourceEndpoint $MigrationEndpointOnprem.Identity -TargetDeliveryDomain azurelab.mail.onmicrosoft.com -CSVData ([System.IO.File]::ReadAllBytes("C:\MigrationBatch1.csv"))

Start-MigrationBatch -Identity $OnboardingBatch.Identity

[ADFS] Web Application Proxy fails with Error Code 0x8007520C


Cannot authenticate WAP in ADFS, after change main settings in either side

We will see the event ID 422 in Event Viewer on WAP server:



Additional Data:

Trust Certificate Thumbprint:
090D9BB9B0471127EDE9CEA66C2AE79223E349FC

Status Code:
Unauthorized

Exception details:
System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()

at Microsoft.IdentityServer.Management.Proxy.StsConfigurationProvider.GetStsProxyConfiguration

In ADFS server, we can see event ID 276:

The federation server proxy was not able to authenticate to the Federation Service.
User Action
Ensure that the proxy is trusted by the Federation Service. To do this, log on to the proxy computer with the host name that is identified in the certificate subject name and re-establish trust between the proxy and the Federation Service using the Install-WebApplicationProxy cmdlet.
Additional Data
Certificate details:
Subject Name:
<null>
Thumbprint:
<null>
NotBefore Time:
<null>
NotAfter Time:
<null>

We need to check the certificate: dir Cert:\LocalMachine\My

Using the thumbprint of the certificate that I want the WAP to use, I am prompted for the service account credentials when I use the following command.
Install-WebApplicationProxy -CertificateThumbprint ’36E56E2F7ECE610C330EE370125454BBE5735A74′ -FederationServiceName ‘adfs.techrede.net’