Category: Powershell

Moving a Hybrid user back to Onprem Exchange.

The is a lot of blogs saying weird things on this particular Powershell command. Here the right one. $onrepm = get-credential ‘alias for the user’ | New-MoveRequest -OutBound -RemoteTargetDatabase ‘local database’ -RemoteHostName ‘ewsurl’ -RemoteCredential $onprem -TargetDeliveryDomain ‘localsmtpdomain’

Continue Reading Moving a Hybrid user back to Onprem Exchange.

Get Migration User statistics.

Here how you can get a listing of user statistics during migration: Get-MigrationUser UserPrincipalName | Get-MigrationUserStatistics | select identity,synceditemcount,percentagecomplete 

Continue Reading Get Migration User statistics.

How to change Network Location Profile manually.

This was tricky. I had implemented several Direct Access configurations, but none of them went crazy like the newest one. Network Location Awereness (NLA) kept changing the localtion of DMZ network adapter to Domain Profile. That is not good for…

Continue Reading How to change Network Location Profile manually.

Sysprep Windows 8 and Windows 10

Hi, If you ever get problems while doing a sysprep on Windows 8 or 10. 1. Unplug network cable or disconnect wifi. 2. Use the powershell command below to cleanup any live-apps, because you cannot sysprep them. get-appxpackage | remove-appxpackage…

Continue Reading Sysprep Windows 8 and Windows 10

How to Find your missing dirsync server.

Hi, Okay, it isn’t so easy, but the following help you to the right track. If you don’t have a separate service-account for Local AD connection, then you can use this: dsquery user -name MSOL_AD_sync If you have a service-account,…

Continue Reading How to Find your missing dirsync server.

Restore emails from disconnected users mailbox.

Hi all, Today I got an assignment to recover a disconnected users mailbox emails received. So here goes. Step 1: Allow permissions to user-account you are using. New-ManagementRoleAssignment –Role “Mailbox Import Export” –User whateveryouareusing Step 2: Connect-Mailbox –Identity disconnecteduser –Database…

Continue Reading Restore emails from disconnected users mailbox.

Reset password of Local Admin account from Windows XP to Windows 10.

Hi all, Today I got a request to reset Local Admin password from Windows XP and Windows 7 machines. After Microsoft released this update https://support.microsoft.com/en-us/kb/2962486?wa=wsignin1.0 Group Policy Preferences stopped working as a way to reset Local passwords. So below is a script…

Continue Reading Reset password of Local Admin account from Windows XP to Windows 10.

Assign permissions for mailboxes before migration.

Note for my self and others 😉 https://technet.microsoft.com/en-us/library/jj898489%28v=exchg.150%29.aspx

Continue Reading Assign permissions for mailboxes before migration.

Recover deleted emails with powershell

And the tip of the day! How to restore deleted items from users deletions-folder before it get’s Purged. First see what format are you using for date: Get-Date  And then use this one-liner (Finnish format for date included :))  for…

Continue Reading Recover deleted emails with powershell

Set Booking Window for all Room Mailboxes with powershell.

Connect to Exchange Online with powershell $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri “https://ps.outlook.com/powershell/” -Credential $cred -Authentication Basic -AllowRedirection  Import-PSSession $session  To change: get-mailbox|where {$_.recipientTypeDetails -eq “roomMailbox”} | Set-CalendarProcessing -BookingWindowInDays 365 To check the windows: get-mailbox|where {$_.recipientTypeDetails -eq “roomMailbox”} | Get-CalendarProcessing…

Continue Reading Set Booking Window for all Room Mailboxes with powershell.