Office 365

Office 365 – How to migrate contacts from Exchange

During an Office 365 migration from an Exchange on-premises, it can be usefull to migrate contacts information. For some reasons, if you can not do a Active Directory synchronization, contacts information needs to be imported manually.

You can easily do that by running two scripts, one in your Exchange environnement which creates an csv file, and the other into the Office 365 Powershell.

Continue reading

Exchange-1

Exchange – Disable access for a mailbox

Sometimes, it can be usefull to disable access to the Exchange server for a specific mailbox. For exemple, in order to forbid Outlook Web App (Outlook on the Web for Exchange 2016) but you do not want to disable the user account. Or you can prestage the mailbox and only allow access to a specific date/ time.

This can also be used during a migration to another mail system: when the user is migrated, you can disable all access to force the user on the new messaging system. And prevent any email sent by the old Exchange.

Exchange Disable access

Exchange Disable access

Let’s see how to disable all access for a mailbox using ECP or Exchange Powershell:

Continue reading

Office 365

Office 365 – Import Regional Configuration

During an Office 365 migration, it can be useful to set the regional configuration before the user logon the first time.

Specify the regional setting prevents the user to register the language and time zone again. Moreover, when you want to import PST files into the new office 365 Mailbox, default folders must have the same name. Otherwise you will get two folders for each default folder, like inbox, Sent, Drafts…

Regional configuration

Regional configuration

This modification can be done using the Office 365 Exchange cmdlet or we can use a powershell script. Let’s see how to do that.

Continue reading

Active Directory 2012

Active Directory – Get Last logon using Powershell

During an Active Directory migration, I needed to do an inventory of the computers to migrate. Because some computers do not exist anymore but not removed from Active Directory. I created a Powershell script based on the Last Logon Timestamp property.

CSV file from the script

CSV file from the script

This powershell script creates a CSV file with the computer name, the last logon property and the operating system. Some domains were based on Windows Server 2003 or 2008, I could not use Active Directory commandlets, so I used the LDAP Search.

Continue reading

Windows10-logo

Windows 10 – Change Network Bindings

With Windows 8.1 and previous operating systems when you want to change the priority of a network card, you could change the Network Bindings using Advanced Settings in Network center.

Network Bindings

Network Bindings

This interface always exists in Windows 10 but this function was deprecated. Changes in “Connections” are no more applied. You can tell me that on a workstation, we don’t use this feature, and it is true. But I faced an issue with Windows 10, VMware Workstation and OpenVPN client.

When my LAB is up and running (Host-Only network), host connected to internet using OpenVPN Client, sometime the host loses access to internet. After troubleshooting, my host queries the DNS in my LAB and not the DNS of OpenVPN interface, and so the query failed because the DNS server does not have access to internet.

Let’s see how to solve this minor issue.

Continue reading

SCCM

SCCM 2012 – Enable Powershell in WinPE

Sometime, you may need to activate Powershell in your SCCM WinPE boot image. This can be used by advanced script, or to display a GUI in Powershell. System Center Configuration Manager 2012 offers the possibility to easily integrated this feature.

WinPE Powershell

WinPE Powershell

How to enable this feature with SCCM 2012 R2:

Continue reading

Exchange-1

Exchange 2013 – Restart all services with Powershell

When you want to fully restart Microsoft Exchange Services, you can not do this by restarting a single service. You have to stop and start each Exchange Service :

Exchange All Services

Exchange All Services

Powershell

Fortunately, we can restart each service using Powershell script:

#Get List of Microsoft Exchange Services
$services = Get-Service | ? { $_.name -like "MSExchange*" -and $_.Status -eq "Running"}
 
#Restart each service
foreach ($service in $services)
{
	Restart-Service $service.name -Force
}
Exchange Powershell Restart Services

Exchange Powershell Restart Services

Windows 8.1

Windows 8.1 – Force Start Menu Layout

When you deploy Windows 8.1 in your environnement, you may define a strategy to force all users to have the same Start Menu Layout. This layout was defined by IT Team and will be provide to all computers.

For example, I set a custom layout: I added some tools and application groups:

Windows 8.1 Custom Start Menu

Windows 8.1 Custom Start Menu

If you want to deploy this Start Menu Layout, you can do it with:

  • Powershell cmdlet on the computer
  • ConfigMgr (SCCM)
  • Group Policy

Continue reading

SCCM

Powershell – Execute SCCM 2012 Applications

Sometimes, it can be useful to execute an Application / Package in the SCCM Software Center using Powershell.
For example, if an application is only available, not required, in the deployment and you want to install several package without logging to the computer.

Unfortunately, there is no built-in powershell cmdlet to do this. We must call method with a specific dll.

Continue reading

WindowsServer

Powershell – Add local Administrator

If you want to add Active Directory user or group to the local administrator group on a computer, you can use Powershell.

User and Group

To add user or group, we can use the cmdlet Invoke-Command associated with net localgroup.

Invoke-Command -ScriptBlock {net Localgroup administrators /add $args[0] } -ArgumentList("LAB\alexandre")

Computer

It is also possible to add a computer account into local Administrator group, you can use the command above but don’t forget to add the $ at the end of computer name.

Invoke-Command -ScriptBlock {net Localgroup administrators /add $args[0] } -ArgumentList("LAB\SRVSCCM$")

More

You can get more informations about net localgroup here.