Powershell

Powershell – Start-Process Credential error

With Windows Powershell, we are able to start a process as another user, with the command Start-Process Credential parameter. But in some conditions, you will get this error: The system cannot find the file specifiedor The Directory name is invalid.

Start-Process Credential The file cannot find the file

Start-Process Credential The file cannot find the file

The error occurs only if the parameter Credential is set. If not, Internet Explorer is starting. Let’s see how to resolve this issue.

Continue reading

Share
Powershell

Powershell – Get Public IP

Today I write a quick tips 🙂 Sometime, we need to know the external public IP address for a computer using Powershell. This can be done easily with a Web Service of ipify.org.

Powershell Public IP

Powershell Public IP

(Invoke-WebRequest -uri "https://api.ipify.org/").Content

More

You can get more information about ipify.org here

Share
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

Share
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

Share
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

Share
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

Share
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

Share
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

Share
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

Share
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

Share