KDB

We share knowledge and experiences with our clients. In order that they can save more time
focusing on their main business. We make IT simple!

Make Guest Users show up in the Address Book (GAL)

Publish Date: 2020/07/17

The first question is “What’s the Guest Users?”When you are granting an outside user external access to your SharePoint Site, they will become Guest User in your organization.

By default, the guest users are hidden from GAL (Global Address List). Until now Microsoft hasn’t provided a simple way to unhide them. If you just starting the account creation and permission settings, I’d like to suggest you delete these guest users, create them in Contacts first and then send SharePoint access invitation to them. It will be quite simple.

If these Guest Users start to visit your SharePoint sites already, re-create the accounts will make them disconnected with previous SharePoint access. Hence, it’s better to use PowerShell to make existing guest users visible.

Let's Get Started!

My computer is running on Windows 10.

1. Launch PowerShell as an Administrator right.

KDB-GAL-install PowerShell

2. Type in Install-Module -Name AzureAD before you connecting to AzureAD.

KDB-GAL-install module

3. Connect to Azure AD.

KDB-GAL-connect-AzureAD

4. Connect to Exchange Online.

$UserCredential = Get-Credential
KDB-GAL-Get-Credential

In the Windows PowerShell Credential Request dialog box, type your work account and password, and then click OK

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
KDB-GAL-New-PSSession

Once connected, enter the following cmdlet to verify.

KDB-GAL-Get-PSSession

5. Make Guest users visible from GAL.

Now the session is available but when I trying to run Get-User cmdlet, it always response the following error message.

KDB-GAL-Error-Message
Now you need to run the following cmdlet to import Exchange Online cmdlets to your local Windows PowerShell session.
KDB-GAL-Import-PSSession

After this step, the Exchange Online cmdlets are imported into your local Windows PowerShell session and tracked by a progress bar. If you don’t receive any errors, you connected successfully. Now you can run Exchange Online cmdlet, for example, Get-User, and see the results.

Once connected, we’re going to use the Get-User cmdlet. This Exchange cmdlet is used for identifying available directory users, just like it is in on-premises Exchange. We’re going to search for a specific recipient type: (in this case, GuestMailUser)

Get-User -RecipientTypeDetails GuestMailUser

KDB-GAL-Get-User
The “GuestMailUser” recipient type tells us that the user is indeed mail-enabled (since it has an email-address). The last thing to do is really just to un-hide it from the Address Book. Use the following command to make the Guest User visable.
Get-User -RecipientTypeDetails GuestMailUser | Set-MailUser -HiddenFromAddressListsEnabled $false
KDB-GAL-guest-visible
Now you can go to Outlook – Global Address Book (Online Address Book) and found these Guest users. You also can check it from Office 365 online – People > Directory.

6. Disconnect PowerShell session.

Be sure to disconnect the remote PowerShell session when you’re finished. If you close the Windows PowerShell window without disconnecting the session, you could use up all the remote PowerShell sessions available to you, and you’ll need to wait for the sessions to expire. To disconnect the remote PowerShell session, run the following command.

 

 

Remove-PSSession $Session
KDB-GAL-disconnect-Azure

Reference List:

In modern enterprise IT operations, identity management, secure access control, and efficient maintenance are essential for ensuring business stability. As a professional IT service provider, Sinokap, with ISO27001 Information Security Management System certification, delivers secure, intelligent, and efficient IT solutions, helping enterprises enhance their IT operational efficiency.

Discover more from Sinokap

Subscribe now to keep reading and get access to the full archive.

Continue reading