You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note:** The only field really needed in the *Name* one just be sure to chose a descriptive name that is easy for you to remember.
58
+
**Note:** The only field really needed in the *Name* one just be sure to choose a descriptive name that is easy for you to remember.
59
59
{: .notice--danger}
60
60
61
61
### Exchange Online Certificate Based authentication - Grant API Permissions
@@ -115,7 +115,7 @@ Thumbprint Subject
115
115
116
116
Open *Certificate Manager* MMC console and under *Certificates Current User / Personal / Certificates* right-click on the certificate and select *All Tasks / Export*. Just follow the export wizard be sure to select *Do not export private key* and select **CER** as the export format.
117
117
118
-
In the Azure Portal select *Certificates and Secretes* from the left blade and *Upload certificate* navigating to the path where the certificate has been expoted/stored
118
+
In the Azure Portal select *Certificates and Secretes* from the left blade and *Upload certificate* navigating to the path where the certificate has been exported/stored
Copy file name to clipboardExpand all lines: _posts/2020-09-25-Azure-Automation-Variables.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ header:
18
18
19
19
## Azure Automation Variables as Shared Resources
20
20
21
-
Shared Resources in Azure Automation allow us to reuse credentials, modules, schedules, connections, certificates and **variables** which will be will be the main focus of this post.
21
+
Shared Resources in Azure Automation allow us to reuse credentials, modules, schedules, connections, certificates and **variables** which will be will be the main focus of the post.
22
22
23
23
To better understand the importance of shared resources and *variables in Azure Automation* let's go through a practical example. I have a runbook pulling data from a web service which requires to reference an API secret as part of the process to obtain an authentication token.
24
24
@@ -131,11 +131,11 @@ As you can see when creating an encrypted variable Value is *omitted* in the out
This is the expected behavior as encrypted variables are *secured* with a unique key generated for each **automation account**. It goes alone encrypted variables are more secure in nature but it has to be kept in mind that, once created, azure automation variables have been created **values cannot be seen only updated**.
134
+
This is the expected behaviour as encrypted variables are *secured* with a unique key generated for each **automation account**. It goes alone encrypted variables are more secure in nature but it has to be kept in mind that, once created, azure automation variables have been created **values cannot be seen only updated**.
135
135
136
136
### Update and Retrieve Azure Automation variable values
137
137
138
-
Now that we know how to create azure automation variables let's see how to work with them and update their values. Recall I had a typo in the unencrypted variable, trailing '[' character, let's fix that from the console
138
+
Now that we know how to create azure automation variables lets see how to work with them and update their values. Recall I had a typo in the unencrypted variable, trailing '[' character, let's fix that from the console
Up to this point we've seen how to create and update Azure Automation variables, let's explore how to get values for configured variables.
201
201
*Az* module makes available a cmdlet for the purpose
@@ -216,7 +216,7 @@ Description : Fixed typo in value
216
216
**Note:** Omitting the *-Name* parameter will return all configured variables
217
217
{: .notice--primary}
218
218
219
-
As I mentioned it is not possible to retrieve values for encrypted variables as they're available within the runbook at runtime via the **Get-AutomationVariable** cmdlet. Using the *Test Encrypted Variable* as example I've created a small script that will show this behavior
219
+
As I mentioned it is not possible to retrieve values for encrypted variables as they're available within the runbook at runtime via the **Get-AutomationVariable** cmdlet. Using the *Test Encrypted Variable* as example I've created a small script that will show this behaviour
Copy file name to clipboardExpand all lines: _posts/2021-05-02-Write-Raspberry-Image-Command-Line.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ header:
16
16
17
17
I am in the process of rebuilding my *Docker/Kubernetes* portable cluster which I build using a couple of RaspberryPi 4 and as part of this I needed to *reflash* the various SD cards where operating system for each node is installed.
18
18
19
-
Usually [Balena Etcher](https://www.balena.io/etcher/) is my go-to tool for such endeavors but being in a rush and not easy way to download the tool on my Linux box I simply used the good old command line, here is how this is done.
19
+
Usually [Balena Etcher](https://www.balena.io/etcher/) is my go-to tool for such endeavours but being in a rush and not easy way to download the tool on my Linux box I simply used the good old command line, here is how this is done.
20
20
21
21
First of all we need to locate the device mapped to our SD card, in my case I'm using a microSD to USB adapter, which can be done with the following command:
This command,despite not as user friendly as the other commands, will return the full UPN of the user for example **PsCustomObject@domain.com**.
51
+
This command,despite not as user friendly as the other commands, will return the full UPN of the user for example **PsCustomObject@domain.com**.
52
52
53
53
I encourage you to explore the other available methods and properties of the *[System.Security.Principal.WindowsIdentity]*[class](https://docs.microsoft.com/en-us/dotnet/api/system.security.principal.windowsidentity?view=net-5.0) as it can be really handy when trying to get details about the current user.
title: "Cannot bind argument to parameter TokenExpiryTime because it is null - Error Message"
3
+
excerpt: "When opening a PowerShell session to both on-prem and Exchange online in the same window cannot bing argument to parameter TokenExpiryTime because is null error message could be displayed. Let's explore how to solve this."
4
+
categories:
5
+
- PowerShell
6
+
- Exchange
7
+
- Office 365
8
+
9
+
tags:
10
+
- PowerShell
11
+
- Office365
12
+
- Exchange
13
+
14
+
toc: true
15
+
header:
16
+
teaser: "/assets/images/PowerShell_Logo.png"
17
+
---
18
+
19
+
## Exchange Online Certificate Based authentication
20
+
21
+
Microsoft is, *finally*, disabling **basic authentication** (read username and password) in Exchange Online in favour of **Certificate Based authentication**.
22
+
23
+
Once this change is fully implemented, around mid February at least for some tenants, connecting via username and passwords to Exchange Online will not be possible anymore.
24
+
25
+
You can read my article on how to implement *Certificate Based authentication* for Exchange Online [here](https://pscustomobject.github.io/powershell/office365/exchange/Exchange-Online-Certificate-Based-Authentication/).
26
+
27
+
As a result of this change I started updating one of our automations, responsible for the whole lifecycle of our mailboxes, to ditch old credential objects in favour of the more secure Certificate Authentication.
28
+
29
+
This is when I encountered the *cannot bind argument to parameter 'token expiry time' because it is null.* error message.
30
+
31
+
## Multiple PowerShell Exchange Sessions
32
+
33
+
When operating an hybrid environment it is pretty common to open, in the same window/session, a PowerShell connection to both Exchange on-prem and Exchange online.
34
+
35
+
This is required as part of the configuration, usually creation of the mailbox, takes place in on-prem for example via the *New-RemoteMailbox* cmdlet while other parts of the configuration are performed directly online.
36
+
37
+
This morning while debugging my workflow I’ve noticed that while trying to retrieve mailbox information from the on-prem server an exception was being thrown
38
+
39
+
```powershell
40
+
# Cmdlet I was running
41
+
Get-RemoteMailbox -Identity $userUpn
42
+
43
+
# Part of the exception message
44
+
Cannot bind argument to parameter 'token expiry time' because it is null.
45
+
```
46
+
47
+
It took me quite a bit to figure this out as no exception during the connection phase was being thrown by either module.
48
+
49
+
When I was about to give up and open a ticket with Microsoft, which is usually as helpful as freezer in the North Pole, I discovered by chance that opening connection to Exchange Online **first** and **only afterwards** to the Exchange on-prem was working as intended, allowing me to interact with both the Online service and my local Exchange.
50
+
51
+
**Note:** I have experienced/tested this with version 2.0.4 and 2.0.5 of Exchange Online PowerShell module but other versions could be affected as well.
52
+
{: .notice—warning}
53
+
54
+
I did not dig deep into the root cause of the issue but plan to do this tomorrow and already sent my feedback to exocmdletpreview {at} service {fullstop} microsoft {fullstop} com but I doubt I will hear anything from that channel. I plan to open a ticket anyhow to at least have an official statement on this.
55
+
56
+
As soon as I have any news I will update the post until then I hope you can find the information useful.
0 commit comments